diff --git a/test/integration/targets/postgresql/aliases b/test/integration/targets/postgresql/aliases index 5d89a661e88..638474beaa7 100644 --- a/test/integration/targets/postgresql/aliases +++ b/test/integration/targets/postgresql/aliases @@ -1,9 +1,6 @@ destructive shippable/posix/group4 postgresql_db -postgresql_lang -postgresql_pg_hba postgresql_privs -postgresql_schema postgresql_user skip/osx diff --git a/test/integration/targets/postgresql/tasks/main.yml b/test/integration/targets/postgresql/tasks/main.yml index 9e11fd03f1c..c734057846b 100644 --- a/test/integration/targets/postgresql/tasks/main.yml +++ b/test/integration/targets/postgresql/tasks/main.yml @@ -23,12 +23,6 @@ # Test postgresql_privs - postgresql_privs.yml - - # Test postgresql_schema module - - postgresql_schema.yml - - # Test postgres_pg_hba module - - postgresql_pg_hba.yml loop_control: loop_var: loop_item @@ -36,15 +30,6 @@ - import_tasks: test_target_role.yml when: postgres_version_resp.stdout is version('9.1', '>=') -# Test postgresql_lang module. -# To implement tests, it needs to install some additional packages -# that may cause problems on different distributions, -# so I restricted the tests using CentOS because the results -# depend only on Postgres version -# (CentOS 6 repo contains the oldest PG version in these tests - 9.0): -- import_tasks: postgresql_lang.yml - when: ansible_distribution == 'CentOS' - # dump/restore tests per format # ============================================================ - include_tasks: state_dump_restore.yml diff --git a/test/integration/targets/postgresql_copy/aliases b/test/integration/targets/postgresql_copy/aliases index ded1c5ac94a..fe75653cadc 100644 --- a/test/integration/targets/postgresql_copy/aliases +++ b/test/integration/targets/postgresql_copy/aliases @@ -1,4 +1,3 @@ destructive shippable/posix/group4 -postgresql_copy skip/osx diff --git a/test/integration/targets/postgresql_ext/aliases b/test/integration/targets/postgresql_ext/aliases index a5f4ec632c7..fe75653cadc 100644 --- a/test/integration/targets/postgresql_ext/aliases +++ b/test/integration/targets/postgresql_ext/aliases @@ -1,4 +1,3 @@ destructive shippable/posix/group4 -postgresql_ext skip/osx diff --git a/test/integration/targets/postgresql_idx/aliases b/test/integration/targets/postgresql_idx/aliases index 4ac11c3d26e..fe75653cadc 100644 --- a/test/integration/targets/postgresql_idx/aliases +++ b/test/integration/targets/postgresql_idx/aliases @@ -1,4 +1,3 @@ destructive shippable/posix/group4 -postgresql_idx skip/osx diff --git a/test/integration/targets/postgresql_info/aliases b/test/integration/targets/postgresql_info/aliases index 31da9b670aa..fe75653cadc 100644 --- a/test/integration/targets/postgresql_info/aliases +++ b/test/integration/targets/postgresql_info/aliases @@ -1,4 +1,3 @@ destructive shippable/posix/group4 -postgresql_info skip/osx diff --git a/test/integration/targets/postgresql_lang/aliases b/test/integration/targets/postgresql_lang/aliases new file mode 100644 index 00000000000..fe75653cadc --- /dev/null +++ b/test/integration/targets/postgresql_lang/aliases @@ -0,0 +1,3 @@ +destructive +shippable/posix/group4 +skip/osx diff --git a/test/integration/targets/postgresql_lang/meta/main.yml b/test/integration/targets/postgresql_lang/meta/main.yml new file mode 100644 index 00000000000..f3345cb6151 --- /dev/null +++ b/test/integration/targets/postgresql_lang/meta/main.yml @@ -0,0 +1,3 @@ +--- +dependencies: +- setup_postgresql_db diff --git a/test/integration/targets/postgresql_lang/tasks/main.yml b/test/integration/targets/postgresql_lang/tasks/main.yml new file mode 100644 index 00000000000..6e6409397ff --- /dev/null +++ b/test/integration/targets/postgresql_lang/tasks/main.yml @@ -0,0 +1,3 @@ +# Initial CI tests of postgresql_lang module +- import_tasks: postgresql_lang_initial.yml + when: ansible_distribution == 'CentOS' diff --git a/test/integration/targets/postgresql/tasks/postgresql_lang.yml b/test/integration/targets/postgresql_lang/tasks/postgresql_lang_initial.yml similarity index 100% rename from test/integration/targets/postgresql/tasks/postgresql_lang.yml rename to test/integration/targets/postgresql_lang/tasks/postgresql_lang_initial.yml diff --git a/test/integration/targets/postgresql_membership/aliases b/test/integration/targets/postgresql_membership/aliases index 70678f4c771..fe75653cadc 100644 --- a/test/integration/targets/postgresql_membership/aliases +++ b/test/integration/targets/postgresql_membership/aliases @@ -1,4 +1,3 @@ destructive shippable/posix/group4 -postgresql_membership skip/osx diff --git a/test/integration/targets/postgresql_owner/aliases b/test/integration/targets/postgresql_owner/aliases index dd925a61405..fe75653cadc 100644 --- a/test/integration/targets/postgresql_owner/aliases +++ b/test/integration/targets/postgresql_owner/aliases @@ -1,4 +1,3 @@ destructive shippable/posix/group4 -postgresql_owner skip/osx diff --git a/test/integration/targets/postgresql_pg_hba/aliases b/test/integration/targets/postgresql_pg_hba/aliases new file mode 100644 index 00000000000..fe75653cadc --- /dev/null +++ b/test/integration/targets/postgresql_pg_hba/aliases @@ -0,0 +1,3 @@ +destructive +shippable/posix/group4 +skip/osx diff --git a/test/integration/targets/postgresql_pg_hba/defaults/main.yml b/test/integration/targets/postgresql_pg_hba/defaults/main.yml new file mode 100644 index 00000000000..4e1fe7dd334 --- /dev/null +++ b/test/integration/targets/postgresql_pg_hba/defaults/main.yml @@ -0,0 +1,23 @@ +--- +pg_hba_test_ips: +- contype: local + users: 'all,postgres,test' +- source: '0000:ffff::' + netmask: 'ffff:fff0::' +- source: '192.168.0.0/24' + netmask: '' + databases: 'all,replication' +- source: '192.168.1.0/24' + netmask: '' + databases: 'all' + method: reject +- source: '127.0.0.1/32' + netmask: '' +- source: '::1/128' + netmask: '' +- source: '0000:ff00::' + netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ff00' + method: scram-sha-256 +- source: '172.16.0.0' + netmask: '255.255.0.0' + method: trust diff --git a/test/integration/targets/postgresql_pg_hba/meta/main.yml b/test/integration/targets/postgresql_pg_hba/meta/main.yml new file mode 100644 index 00000000000..f3345cb6151 --- /dev/null +++ b/test/integration/targets/postgresql_pg_hba/meta/main.yml @@ -0,0 +1,3 @@ +--- +dependencies: +- setup_postgresql_db diff --git a/test/integration/targets/postgresql_pg_hba/tasks/main.yml b/test/integration/targets/postgresql_pg_hba/tasks/main.yml new file mode 100644 index 00000000000..3388e9b6e5f --- /dev/null +++ b/test/integration/targets/postgresql_pg_hba/tasks/main.yml @@ -0,0 +1,2 @@ +# Initial CI tests of postgresql_pg_hba module +- import_tasks: postgresql_pg_hba_initial.yml diff --git a/test/integration/targets/postgresql/tasks/postgresql_pg_hba.yml b/test/integration/targets/postgresql_pg_hba/tasks/postgresql_pg_hba_initial.yml similarity index 100% rename from test/integration/targets/postgresql/tasks/postgresql_pg_hba.yml rename to test/integration/targets/postgresql_pg_hba/tasks/postgresql_pg_hba_initial.yml diff --git a/test/integration/targets/postgresql_ping/aliases b/test/integration/targets/postgresql_ping/aliases index ca9d9606331..fe75653cadc 100644 --- a/test/integration/targets/postgresql_ping/aliases +++ b/test/integration/targets/postgresql_ping/aliases @@ -1,4 +1,3 @@ destructive shippable/posix/group4 -postgresql_ping skip/osx diff --git a/test/integration/targets/postgresql_publication/aliases b/test/integration/targets/postgresql_publication/aliases index c2110e0a3b7..fe75653cadc 100644 --- a/test/integration/targets/postgresql_publication/aliases +++ b/test/integration/targets/postgresql_publication/aliases @@ -1,4 +1,3 @@ destructive shippable/posix/group4 -postgresql_publication skip/osx diff --git a/test/integration/targets/postgresql_query/aliases b/test/integration/targets/postgresql_query/aliases index 9a87d62ddcd..fe75653cadc 100644 --- a/test/integration/targets/postgresql_query/aliases +++ b/test/integration/targets/postgresql_query/aliases @@ -1,4 +1,3 @@ destructive shippable/posix/group4 -postgresql_query skip/osx diff --git a/test/integration/targets/postgresql_schema/aliases b/test/integration/targets/postgresql_schema/aliases new file mode 100644 index 00000000000..fe75653cadc --- /dev/null +++ b/test/integration/targets/postgresql_schema/aliases @@ -0,0 +1,3 @@ +destructive +shippable/posix/group4 +skip/osx diff --git a/test/integration/targets/postgresql_schema/defaults/main.yml b/test/integration/targets/postgresql_schema/defaults/main.yml new file mode 100644 index 00000000000..43f5af51248 --- /dev/null +++ b/test/integration/targets/postgresql_schema/defaults/main.yml @@ -0,0 +1,4 @@ +--- +db_name: 'ansible_db' +db_user1: 'ansible_db_user1' +db_user2: 'ansible_db_user2' diff --git a/test/integration/targets/postgresql_schema/meta/main.yml b/test/integration/targets/postgresql_schema/meta/main.yml new file mode 100644 index 00000000000..f3345cb6151 --- /dev/null +++ b/test/integration/targets/postgresql_schema/meta/main.yml @@ -0,0 +1,3 @@ +--- +dependencies: +- setup_postgresql_db diff --git a/test/integration/targets/postgresql_schema/tasks/main.yml b/test/integration/targets/postgresql_schema/tasks/main.yml new file mode 100644 index 00000000000..2bb7f20fb7d --- /dev/null +++ b/test/integration/targets/postgresql_schema/tasks/main.yml @@ -0,0 +1,2 @@ +# Initial CI tests of postgresql_schema module +- import_tasks: postgresql_schema_initial.yml diff --git a/test/integration/targets/postgresql/tasks/postgresql_schema.yml b/test/integration/targets/postgresql_schema/tasks/postgresql_schema_initial.yml similarity index 98% rename from test/integration/targets/postgresql/tasks/postgresql_schema.yml rename to test/integration/targets/postgresql_schema/tasks/postgresql_schema_initial.yml index 050ee074efe..6e0720355ee 100644 --- a/test/integration/targets/postgresql/tasks/postgresql_schema.yml +++ b/test/integration/targets/postgresql_schema/tasks/postgresql_schema_initial.yml @@ -1,6 +1,19 @@ --- # Setup +- name: Create test roles + postgresql_user: + name: "{{ item }}" + state: present + encrypted: yes + password: password + role_attr_flags: LOGIN + db: postgres + login_user: "{{ pg_user }}" + loop: + - "{{ db_user1 }}" + - "{{ db_user2 }}" + - name: Create DB become_user: "{{ pg_user }}" become: yes @@ -10,16 +23,6 @@ owner: "{{ db_user1 }}" login_user: "{{ pg_user }}" -- name: Create a user to be owner of a schema - postgresql_user: - name: "{{ db_user2 }}" - state: present - encrypted: yes - password: password - role_attr_flags: LOGIN - db: "{{ db_name }}" - login_user: "{{ pg_user }}" - # Test: CREATE SCHEMA in checkmode - name: Create a new schema with name "acme" in check_mode become_user: "{{ pg_user }}" diff --git a/test/integration/targets/postgresql_sequence/aliases b/test/integration/targets/postgresql_sequence/aliases index d5dcfcf3431..fe75653cadc 100644 --- a/test/integration/targets/postgresql_sequence/aliases +++ b/test/integration/targets/postgresql_sequence/aliases @@ -1,4 +1,3 @@ destructive shippable/posix/group4 -postgresql_sequence skip/osx diff --git a/test/integration/targets/postgresql_set/aliases b/test/integration/targets/postgresql_set/aliases index 269d653bf44..fe75653cadc 100644 --- a/test/integration/targets/postgresql_set/aliases +++ b/test/integration/targets/postgresql_set/aliases @@ -1,4 +1,3 @@ destructive shippable/posix/group4 -postgresql_set skip/osx diff --git a/test/integration/targets/postgresql_slot/aliases b/test/integration/targets/postgresql_slot/aliases index 17e12dc781b..fe75653cadc 100644 --- a/test/integration/targets/postgresql_slot/aliases +++ b/test/integration/targets/postgresql_slot/aliases @@ -1,4 +1,3 @@ destructive shippable/posix/group4 -postgresql_slot skip/osx diff --git a/test/integration/targets/postgresql_table/aliases b/test/integration/targets/postgresql_table/aliases index 6b05d5230aa..fe75653cadc 100644 --- a/test/integration/targets/postgresql_table/aliases +++ b/test/integration/targets/postgresql_table/aliases @@ -1,4 +1,3 @@ destructive shippable/posix/group4 -postgresql_table skip/osx diff --git a/test/integration/targets/postgresql_tablespace/aliases b/test/integration/targets/postgresql_tablespace/aliases index 489dbd6f0a0..fe75653cadc 100644 --- a/test/integration/targets/postgresql_tablespace/aliases +++ b/test/integration/targets/postgresql_tablespace/aliases @@ -1,4 +1,3 @@ destructive shippable/posix/group4 -postgresql_tablespace skip/osx