From 95b59cd76c7821eacd38d736c60e902e43e289ed Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 4 Jan 2017 16:41:18 -0800 Subject: [PATCH] Remove `needs/privileged` from postgresql test. (#19907) * Remove `needs/privileged` from postgresql test. * Add python 3 support to postgresql tests. --- test/integration/targets/postgresql/aliases | 1 - .../targets/setup_postgresql_db/tasks/main.yml | 18 ++++++++++++++---- .../setup_postgresql_db/vars/Ubuntu-16-py3.yml | 10 ++++++++++ 3 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 test/integration/targets/setup_postgresql_db/vars/Ubuntu-16-py3.yml diff --git a/test/integration/targets/postgresql/aliases b/test/integration/targets/postgresql/aliases index 57a7cd8e893..8c690a8600b 100644 --- a/test/integration/targets/postgresql/aliases +++ b/test/integration/targets/postgresql/aliases @@ -1,5 +1,4 @@ destructive -needs/privileged posix/ci/group1 postgresql_db postgresql_privs diff --git a/test/integration/targets/setup_postgresql_db/tasks/main.yml b/test/integration/targets/setup_postgresql_db/tasks/main.yml index 351e5c89589..303fef3e459 100644 --- a/test/integration/targets/setup_postgresql_db/tasks/main.yml +++ b/test/integration/targets/setup_postgresql_db/tasks/main.yml @@ -1,10 +1,20 @@ +- name: python 2 + set_fact: + python_suffix: "" + when: ansible_python_version | version_compare('3', '<') + +- name: python 3 + set_fact: + python_suffix: "-py3" + when: ansible_python_version | version_compare('3', '>=') + - include_vars: '{{ item }}' with_first_found: - files: - - '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml' - - '{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml' - - '{{ ansible_os_family }}.yml' - - 'default.yml' + - '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}{{ python_suffix }}.yml' + - '{{ ansible_distribution }}-{{ ansible_distribution_version }}{{ python_suffix }}.yml' + - '{{ ansible_os_family }}{{ python_suffix }}.yml' + - 'default{{ python_suffix }}.yml' paths: '../vars' # Make sure we start fresh diff --git a/test/integration/targets/setup_postgresql_db/vars/Ubuntu-16-py3.yml b/test/integration/targets/setup_postgresql_db/vars/Ubuntu-16-py3.yml new file mode 100644 index 00000000000..1c5fd353dc2 --- /dev/null +++ b/test/integration/targets/setup_postgresql_db/vars/Ubuntu-16-py3.yml @@ -0,0 +1,10 @@ +postgresql_service: "postgresql" + +postgresql_packages: + - "postgresql" + - "postgresql-common" + - "python3-psycopg2" + +pg_hba_location: "/etc/postgresql/9.5/main/pg_hba.conf" +pg_dir: "/var/lib/postgresql/9.5/main" +pg_ver: 9.5