summaryrefslogtreecommitdiff
path: root/test/integration/targets/setup_postgresql_db
diff options
context:
space:
mode:
authorMatt Clay <matt@mystile.com>2017-01-04 16:41:18 -0800
committerGitHub <noreply@github.com>2017-01-04 16:41:18 -0800
commit95b59cd76c7821eacd38d736c60e902e43e289ed (patch)
treea2f33cbe9a11ef0aa9e09bac913849ccf0964992 /test/integration/targets/setup_postgresql_db
parent709a3aa42b829b13f4d58d9c0d4748d46be826b4 (diff)
downloadansible-95b59cd76c7821eacd38d736c60e902e43e289ed.tar.gz
Remove `needs/privileged` from postgresql test. (#19907)
* Remove `needs/privileged` from postgresql test. * Add python 3 support to postgresql tests.
Diffstat (limited to 'test/integration/targets/setup_postgresql_db')
-rw-r--r--test/integration/targets/setup_postgresql_db/tasks/main.yml18
-rw-r--r--test/integration/targets/setup_postgresql_db/vars/Ubuntu-16-py3.yml10
2 files changed, 24 insertions, 4 deletions
diff --git a/test/integration/targets/setup_postgresql_db/tasks/main.yml b/test/integration/targets/setup_postgresql_db/tasks/main.yml
index 351e5c8958..303fef3e45 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 0000000000..1c5fd353dc
--- /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