|
85 | 85 | password: "{{ item.password }}"
|
86 | 86 | state: present
|
87 | 87 |
|
88 |
| -- name: Multiple databases GRANT ALL PRIVILEGES ON DATABASE to user |
| 88 | +- name: Multiple databases GRANT ALL PRIVILEGES ON DATABASE TO user |
89 | 89 | with_items: "{{ mailman3_database_list }}"
|
90 | 90 | become: true
|
91 | 91 | become_user: postgres
|
|
97 | 97 | type: database
|
98 | 98 | role: "{{ item.username }}"
|
99 | 99 |
|
100 |
| -- name: Multiple databases GRANT ALL PRIVILEGES ON SCHEMA public to user |
| 100 | +- name: Multiple databases GRANT ALL PRIVILEGES ON SCHEMA public TO user |
101 | 101 | with_items: "{{ mailman3_database_list }}"
|
102 | 102 | become: true
|
103 | 103 | become_user: postgres
|
|
110 | 110 | objs: public
|
111 | 111 | role: "{{ item.username }}"
|
112 | 112 |
|
| 113 | +# item.additional_readonly_users should be in the form of a comma-separated string |
| 114 | +- name: Multiple databases GRANT SELECT ON ALL TABLES IN SCHEMA public TO additional users |
| 115 | + with_items: "{{ mailman3_database_list }}" |
| 116 | + become: true |
| 117 | + become_user: postgres |
| 118 | + vars: |
| 119 | + ansible_ssh_pipelining: true |
| 120 | + community.postgresql.postgresql_privs: |
| 121 | + db: "{{ item.name }}" |
| 122 | + privs: SELECT |
| 123 | + type: table |
| 124 | + schema: public |
| 125 | + objs: ALL_IN_SCHEMA |
| 126 | + role: "{{ item.additional_readonly_users }}" |
| 127 | + when: item.additional_readonly_users is defined |
| 128 | + |
| 129 | +# item.additional_readonly_users should be in the form of a comma-separated string |
| 130 | +- name: Multiple databases ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO additional users |
| 131 | + with_items: "{{ mailman3_database_list }}" |
| 132 | + become: true |
| 133 | + become_user: postgres |
| 134 | + vars: |
| 135 | + ansible_ssh_pipelining: true |
| 136 | + community.postgresql.postgresql_privs: |
| 137 | + db: "{{ item.name }}" |
| 138 | + privs: SELECT |
| 139 | + type: default_privs |
| 140 | + schema: public |
| 141 | + objs: TABLES |
| 142 | + role: "{{ item.additional_readonly_users }}" |
| 143 | + when: item.additional_readonly_users is defined |
| 144 | + |
| 145 | + |
113 | 146 | - name: Multiple databases configure pg_hba
|
114 | 147 | with_items: "{{ mailman3_database_list }}"
|
115 | 148 | ansible.builtin.lineinfile:
|
|
0 commit comments