postgresql_privs: fix the module mistakes a procedure for a function (#996)

* postgresql_privs: fix the module mistakes a procedure for a function

* add changelog fragment

* fix
This commit is contained in:
Andrew Klychkov 2020-09-29 21:27:30 +03:00 committed by GitHub
parent 104f6a3e96
commit 220051768b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 5 deletions

View file

@ -653,6 +653,35 @@
login_user: "{{ db_user3 }}"
login_password: password
# Issue https://github.com/ansible-collections/community.general/issues/994
- name: Create a procedure for tests
postgresql_query:
query: "CREATE PROCEDURE mock_procedure() LANGUAGE SQL AS $$ SELECT 1; $$;"
db: "{{ db_name }}"
login_user: "{{ db_user3 }}"
login_password: password
when: postgres_version_resp.stdout is version('11', '>=')
# Issue https://github.com/ansible-collections/community.general/issues/994
- name: Try to run module against a procedure, not function
postgresql_privs:
type: function
state: present
privs: ALL
roles: "{{ db_user2 }}"
objs: ALL_IN_SCHEMA
schema: public
db: "{{ db_name }}"
login_user: "{{ db_user3 }}"
login_password: password
register: result
when: postgres_version_resp.stdout is version('11', '>=')
- assert:
that:
- result is not changed
when: postgres_version_resp.stdout is version('11', '>=')
#################################################
# Test ALL_IN_SCHEMA for 'partioned tables type #
#################################################