Use postgresql_privs
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
jeltz 2021-03-10 14:27:14 +01:00
parent 40eadf802c
commit 06b54d5f89
1 changed files with 11 additions and 1 deletions

View File

@ -57,7 +57,17 @@
db: "{{ item.database }}"
name: "{{ item.name }}"
password: "{{ item.password }}"
priv: "{{ item.priv }}"
no_log: true
loop: "{{ postgresql_users }}"
- name: Grant privileges to users
become: true
become_user: postgres
postgresql_privs:
db: postgres
type: database
role: "{{ item.name }}"
privs: "{{ item.privs | join(',') }}"
obj: "{{ item.database }}"
loop: "{{ postgresql_users }}"
...