Add configuration for users and databases
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
jeltz 2021-03-10 13:23:52 +01:00
parent 879e033857
commit 9ef6202fdf
2 changed files with 18 additions and 0 deletions

View file

@ -0,0 +1,4 @@
---
postgresql_db: []
postgresql_users: []
...

View file

@ -37,3 +37,17 @@
- postgresql.conf - postgresql.conf
notify: notify:
- restart postgresql - restart postgresql
- name: Create databases
postgresql_db:
name: "{{ item.name }}"
loop: "{{ postgresql_databases }}"
- name: Create users
postgresql_user:
db: "{{ item.database }}"
name: "{{ item.name }}"
password: "{{ item.password }}"
priv: "{{ item.priv }}"
loop: "{{ postgresql_users }}"
...