postgresql_lang: add trust_input parameter (#272)

* postgresql_lan: add trust_input parameter

* add changelog fragment
This commit is contained in:
Andrew Klychkov 2020-05-05 16:37:08 +03:00 committed by GitHub
commit 19cad71f25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 4 deletions

View file

@ -30,6 +30,7 @@
<<: *pg_parameters
name: '{{ test_lang }}'
owner: '{{ test_user1 }}'
trust_input: no
check_mode: yes
- assert:
@ -57,11 +58,12 @@
<<: *pg_parameters
name: '{{ test_lang }}'
owner: '{{ test_user1 }}'
trust_input: no
- assert:
that:
- result is changed
- result.queries == ['CREATE LANGUAGE "{{ test_lang }}"', 'ALTER LANGUAGE "{{ test_lang }}" OWNER TO {{ test_user1 }}']
- result.queries == ['CREATE LANGUAGE "{{ test_lang }}"', 'ALTER LANGUAGE "{{ test_lang }}" OWNER TO "{{ test_user1 }}"']
- name: Check
<<: *task_parameters
@ -83,12 +85,13 @@
<<: *pg_parameters
name: '{{ test_lang }}'
owner: '{{ test_user2 }}'
trust_input: yes
check_mode: yes
- assert:
that:
- result is changed
- result.queries == ['ALTER LANGUAGE "{{ test_lang }}" OWNER TO {{ test_user2 }}']
- result.queries == ['ALTER LANGUAGE "{{ test_lang }}" OWNER TO "{{ test_user2 }}"']
- name: Check that nothing was actually changed
<<: *task_parameters
@ -116,7 +119,7 @@
- result is changed
# TODO: the first elem of the returned list below
# looks like a bug, not related with the option owner, needs to be checked
- result.queries == ["UPDATE pg_language SET lanpltrusted = false WHERE lanname = '{{ test_lang }}'", 'ALTER LANGUAGE "{{ test_lang }}" OWNER TO {{ test_user2 }}']
- result.queries == ["UPDATE pg_language SET lanpltrusted = false WHERE lanname = '{{ test_lang }}'", 'ALTER LANGUAGE "{{ test_lang }}" OWNER TO "{{ test_user2 }}"']
- name: Check
<<: *task_parameters