Postgresql privs reformat (#54717)

* postgresql_privs: fix doc format, pgutils

* postgresql_privs: added pgutils, ret value

* postgresql_privs: fix test

* postgresql_privs: fixes

* postgresql_privs: fixes

* postgresql_privs: fixed CI
This commit is contained in:
Andrey Klychkov 2019-04-02 18:48:35 +03:00 committed by John R Barker
parent 7ea01da38f
commit 40f65a54ec
8 changed files with 243 additions and 173 deletions

View file

@ -23,13 +23,23 @@
# Prepare SQL script:
- name: postgresql_query - remove SQL script if exists
become_user: "{{ pg_user }}"
become: yes
file:
path: '~{{ pg_user}}/test.sql'
state: absent
ignore_errors: yes
- name: postgresql_query - create an empty file to check permission
become: yes
file:
path: '~{{ pg_user}}/test.sql'
state: touch
owner: '{{ pg_user }}'
group: '{{ pg_user }}'
mode: 0644
register: sql_file_created
ignore_errors: yes
- name: postgresql_query - prepare SQL script
become_user: "{{ pg_user }}"
become: yes
@ -39,6 +49,7 @@
- SELECT version();
- SELECT story FROM test_table
- WHERE id = %s;
when: sql_file_created
##############
# Start tests:
@ -75,6 +86,7 @@
- 1
register: result
ignore_errors: yes
when: sql_file_created
- assert:
that:
@ -83,6 +95,7 @@
- result.rowcount == 1
- result.statusmessage == 'SELECT 1' or result.statusmessage == 'SELECT'
- result.query_result[0].story == 'first'
when: sql_file_created
# Simple select query:
- name: postgresql_query - simple select query to test_table