Detect and fix environment tampering in tests.

This commit is contained in:
Matt Clay 2017-05-11 19:05:21 +08:00
commit b8cb3f519b
3 changed files with 109 additions and 4 deletions

View file

@ -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