Mohammed Naser 51d8013d9e Fix molecule
Change-Id: I5af66980cfc1ffebea46cdbc4b29fdf6786ba879
2022-04-29 21:28:02 -04:00

38 lines
1.1 KiB
YAML

---
- hosts: ubuntu-focal
roles:
- role: ensure-clouds-yaml
- role: ensure-molecule
vars:
molecule_version: 3.5.2
- hosts: ubuntu-focal
tasks:
- name: molecule prepare
shell: "{{ molecule_executable }} prepare"
args:
chdir: "{{ zuul.project.src_dir }}"
- name: Grab the Molecule instance configuration
set_fact:
molecule_instance_config: "{{ lookup('file', molecule_instance_config_path) | from_yaml }}"
vars:
molecule_instance_config_path: "{{ ansible_user_dir }}/.cache/molecule/{{ zuul.project.short_name }}/default/instance_config.yml"
- name: Add all of the hosts to the inventory
add_host:
name: "{{ item.instance }}"
ansible_user: "{{ item.user }}"
ansible_host: "{{ item.address }}"
ansible_port: "{{ item.port }}"
ansible_private_key_file: "{{ item.identity_file }}"
ansible_ssh_extra_args: -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
loop: "{{ molecule_instance_config }}"
loop_control:
label: "{{ item.instance }}"
- hosts: all
tasks:
- ping: