Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgresql_privs: fails with type=default_privs, privs=ALL, objs=ALL_DEFAULT #374

Merged
merged 1 commit into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/0-postgresql_privs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- postgresql_privs - fails with ``type=default_privs``, ``privs=ALL``, ``objs=ALL_DEFAULT`` (https://github.com/ansible-collections/community.postgresql/issues/373).
1 change: 1 addition & 0 deletions plugins/modules/postgresql_privs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,7 @@ def main():

elif p.type == 'default_privs':
if p.objs == 'ALL_DEFAULT':
VALID_DEFAULT_OBJS.pop('SCHEMAS')
objs = frozenset(VALID_DEFAULT_OBJS.keys())
else:
objs = frozenset(obj.upper() for obj in p.objs.split(','))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1544,6 +1544,22 @@
that:
- result is not changed

- name: Test community.postgresql issue 373
become: yes
become_user: "{{ pg_user }}"
postgresql_privs:
login_user: "{{ pg_user }}"
login_db: "{{ db_name }}"
roles: "{{ db_user3 }}"
objs: ALL_DEFAULT
type: default_privs
privs: ALL
register: result

- assert:
that:
- result is changed

# Cleanup
- name: Remove privs
become: true
Expand Down