|
|
|
@ -186,17 +186,8 @@
|
|
|
|
|
#
|
|
|
|
|
# Create and destroy user, test 'password' and 'encrypted' parameters
|
|
|
|
|
#
|
|
|
|
|
- include: test_password.yml
|
|
|
|
|
vars:
|
|
|
|
|
encrypted: '{{ item.user_creation_encrypted_value }}'
|
|
|
|
|
db_password1: 'secretù' # use UTF-8
|
|
|
|
|
with_items:
|
|
|
|
|
- user_creation_encrypted_value: 'yes'
|
|
|
|
|
- user_creation_encrypted_value: 'no'
|
|
|
|
|
|
|
|
|
|
# BYPASSRLS role attribute was introduced in PostgreSQL 9.5, so
|
|
|
|
|
# we want to test atrribute management differently depending
|
|
|
|
|
# on the version.
|
|
|
|
|
# unencrypted values are not supported on newer versions
|
|
|
|
|
# do not run the encrypted: no tests if on 10+
|
|
|
|
|
- name: Get PostgreSQL version
|
|
|
|
|
become_user: "{{ pg_user }}"
|
|
|
|
|
become: True
|
|
|
|
@ -207,6 +198,23 @@
|
|
|
|
|
debug:
|
|
|
|
|
msg: "{{ postgres_version_resp.stdout }}"
|
|
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
|
encryption_values:
|
|
|
|
|
- 'yes'
|
|
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
|
encryption_values: '{{ encryption_values }} + ["no"]'
|
|
|
|
|
when: postgres_version_resp.stdout is version('10', '<=')
|
|
|
|
|
|
|
|
|
|
- include: test_password.yml
|
|
|
|
|
vars:
|
|
|
|
|
encrypted: '{{ item }}'
|
|
|
|
|
db_password1: 'secretù' # use UTF-8
|
|
|
|
|
loop: '{{ encryption_values }}'
|
|
|
|
|
|
|
|
|
|
# BYPASSRLS role attribute was introduced in PostgreSQL 9.5, so
|
|
|
|
|
# we want to test atrribute management differently depending
|
|
|
|
|
# on the version.
|
|
|
|
|
- set_fact:
|
|
|
|
|
bypassrls_supported: "{{ postgres_version_resp.stdout is version('9.5.0', '>=') }}"
|
|
|
|
|
|
|
|
|
@ -648,7 +656,7 @@
|
|
|
|
|
postgresql_user:
|
|
|
|
|
name: "{{ db_user1 }}"
|
|
|
|
|
state: "present"
|
|
|
|
|
encrypted: 'no'
|
|
|
|
|
encrypted: 'yes'
|
|
|
|
|
password: "password"
|
|
|
|
|
role_attr_flags: "CREATEDB,LOGIN,CREATEROLE"
|
|
|
|
|
login_user: "{{ pg_user }}"
|
|
|
|
|