16cce92a74
Molecule also needs to be bumped to support Ansible 2.10 lint: section changed in Molecule 3.x - adapted. molecule-docker added do test-reqs because it code has moved to it from molecule core pytest-testinfra and pytest-molecule needed for testinfra tests to work [1]: https://github.com/ansible-community/molecule/issues/2872 Change-Id: I0299f5126ebd080f3912a76294b0013abe7747a0
28 lines
825 B
YAML
28 lines
825 B
YAML
---
|
|
- name: Destroy
|
|
hosts: localhost
|
|
connection: local
|
|
gather_facts: false
|
|
no_log: "{{ not lookup('env', 'MOLECULE_DEBUG') | bool }}"
|
|
vars:
|
|
molecule_file: "{{ lookup('env', 'MOLECULE_FILE') }}"
|
|
molecule_yml: "{{ lookup('file', molecule_file) | community.molecule.from_yaml }}"
|
|
tasks:
|
|
- name: Destroy molecule instance(s)
|
|
docker_container:
|
|
name: "{{ item.name }}"
|
|
state: absent
|
|
force_kill: "{{ item.force_kill | default(true) }}"
|
|
register: server
|
|
with_items: "{{ molecule_yml.platforms }}"
|
|
async: 7200
|
|
poll: 0
|
|
|
|
- name: Wait for instance(s) deletion to complete
|
|
async_status:
|
|
jid: "{{ item.ansible_job_id }}"
|
|
register: docker_jobs
|
|
until: docker_jobs.finished
|
|
retries: 300
|
|
with_items: "{{ server.results }}"
|