zuul-jobs/playbooks/tox/pre-molecule.yaml
Sagi Shnaidman 4d168ed016 Rename vars/ directory to prevent conflicts
/vars directories from 'tox' playbook and roles are merged, which
creates conflicts and wrong variables are loaded into the playbook
Prevent merge of /vars directories from roles and 'tox' playbook
by renaming variables directory of playbook to molecule-vars.
It should fix failing job tripleo-ansible-centos-7-role-addition

Change-Id: Iee6768a27db36a3a18c0728040ab9c09857d55b6
2020-01-13 02:30:17 +02:00

28 lines
1.0 KiB
YAML

- hosts: all
vars:
tox_molecule_packages: "{{ _tox_molecule_packages | default([]) }}"
tasks:
- name: Gather variables for each operating system
include_vars: "{{ item }}"
with_first_found:
- skip: true
files:
- "molecule-vars/{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yaml"
- "molecule-vars/{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yaml"
- "molecule-vars/{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yaml"
- "molecule-vars/{{ ansible_distribution | lower }}.yaml"
- "molecule-vars/{{ ansible_os_family | lower }}-{{ ansible_distribution_version.split('.')[0] }}.yaml"
- "molecule-vars/{{ ansible_os_family | lower }}.yaml"
tags:
- always
- name: Install packages needed by molecule
become: true
package:
name: "{{ tox_molecule_packages }}"
when:
- (tox_molecule_packages | length) > 0
roles:
- role: install-docker