summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/setup_mysql_db
diff options
context:
space:
mode:
authorMatt Clay <matt@mystile.com>2017-05-11 13:05:21 +0200
committerMatt Clay <matt@mystile.com>2017-05-11 13:45:15 +0200
commitb8cb3f519be272ca810f8186820205723a209d38 (patch)
treeba61d7650b09e5c728bc8360f775f27fea4506c9 /test/integration/targets/setup_mysql_db
parentTemporarily disable test which fails in group run. (diff)
downloadansible-b8cb3f519be272ca810f8186820205723a209d38.tar.xz
ansible-b8cb3f519be272ca810f8186820205723a209d38.zip
Detect and fix environment tampering in tests.
Diffstat (limited to 'test/integration/targets/setup_mysql_db')
-rw-r--r--test/integration/targets/setup_mysql_db/tasks/main.yml19
-rw-r--r--test/integration/targets/setup_mysql_db/vars/Ubuntu-16-py3.yml6
2 files changed, 21 insertions, 4 deletions
diff --git a/test/integration/targets/setup_mysql_db/tasks/main.yml b/test/integration/targets/setup_mysql_db/tasks/main.yml
index fc986f4d4d..be605816d7 100644
--- a/test/integration/targets/setup_mysql_db/tasks/main.yml
+++ b/test/integration/targets/setup_mysql_db/tasks/main.yml
@@ -17,13 +17,24 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# ============================================================
+- 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_os_family }}-{{ ansible_distribution_major_version }}.yml'
- - '{{ ansible_distribution }}.yml'
- - '{{ ansible_os_family }}.yml'
+ - '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}{{ python_suffix }}.yml'
+ - '{{ ansible_os_family }}-{{ ansible_distribution_major_version }}{{ python_suffix }}.yml'
+ - '{{ ansible_distribution }}{{ python_suffix }}.yml'
+ - '{{ ansible_os_family }}{{ python_suffix }}.yml'
+ - 'default{{ python_suffix }}.yml'
paths: '../vars'
- name: install mysqldb_test rpm dependencies
diff --git a/test/integration/targets/setup_mysql_db/vars/Ubuntu-16-py3.yml b/test/integration/targets/setup_mysql_db/vars/Ubuntu-16-py3.yml
new file mode 100644
index 0000000000..bffbf58895
--- /dev/null
+++ b/test/integration/targets/setup_mysql_db/vars/Ubuntu-16-py3.yml
@@ -0,0 +1,6 @@
+mysql_service: 'mysql'
+
+mysql_packages:
+ - mysql-server
+ - python3-mysqldb
+ - bzip2