postgresql_privs: add usage_on_types option (#941) (#955)

* postgresql_privs: add usage_of_types option

* add CI tests

* add changelog fragment

(cherry picked from commit 77bf8b9a66)

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
This commit is contained in:
patchback[bot] 2020-09-24 10:33:42 +03:00 committed by GitHub
commit 90ed2fa5c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 55 additions and 9 deletions

View file

@ -71,6 +71,7 @@
that:
- result is changed
# Also covers https://github.com/ansible-collections/community.general/issues/884
- name: Set table default privs on the schema with hyphen in the name
postgresql_privs:
login_user: "{{ pg_user }}"
@ -82,11 +83,34 @@
obj: TABLES
privs: all
state: present
usage_on_types: yes
register: result
check_mode: yes
- assert:
that:
- result is changed
- result.queries is search('ON TYPES')
# Also covers https://github.com/ansible-collections/community.general/issues/884
- name: Set table default privs on the schema with hyphen in the name
postgresql_privs:
login_user: "{{ pg_user }}"
password: password
db: "{{ db_name_with_hyphens }}"
schema: "{{ db_schema_with_hyphens }}"
role: "{{ db_user_with_hyphens }}"
type: default_privs
obj: TABLES
privs: all
state: present
usage_on_types: no
register: result
- assert:
that:
- result is changed
- result.queries is not search('ON TYPES')
- name: Delete table default privs on the schema with hyphen in the name
postgresql_privs: