This commit is contained in:
dima
2024-11-11 00:17:33 +03:00
parent 015d96995e
commit 66471a8a89
17 changed files with 252 additions and 137 deletions

View File

@ -0,0 +1,17 @@
- name: Create PostgreSQL database
community.postgresql.postgresql_db:
name: '{{ postgres_db }}'
owner: '{{ postgres_user }}'
encoding: UTF8
state: present
tags:
- database
- name: Create contacts table in PostgreSQL
community.postgresql.postgresql_query:
db: '{{ postgres_db }}'
query: 'CREATE TABLE IF NOT EXISTS contacts (id SERIAL PRIMARY KEY, name VARCHAR(100), phone_number VARCHAR(15));'
login_user: '{{ postgres_user }}'
login_password: '{{ postgres_password }}'
tags:
- database