kayobe/ansible/roles/inspection-store/tasks/destroy.yml
Mark Goddard 5304c0a489 Add a data store for ironic inspector introspection data
In environments without Swift we are currently unable to store hardware
introspection data. The inspection_store container runs an nginx server
that supports a restricted Swift-like HTTP API using WebDAV that supports
upload and retrieval of introspection data.
2017-09-01 18:21:10 +00:00

30 lines
832 B
YAML

---
- name: Ensure inspection store container is stopped
docker_container:
name: "{{ item.value.container_name }}"
state: "absent"
with_dict: "{{ inspection_store_services }}"
- name: Check whether inspection store volumes are present
command: docker volume inspect {{ volume }}
changed_when: False
with_subelements:
- "{{ inspection_store_services }}"
- volumes
when: "'/' not in volume"
failed_when:
- volume_result.rc != 0
- "'No such volume' not in volume_result.stderr"
vars:
volume: "{{ item.1.split(':')[0] }}"
register: volume_result
- name: Ensure inspection store volumes are absent
command: docker volume rm {{ volume }}
with_items: "{{ volume_result.results }}"
when:
- not item | skipped
- item.rc == 0
vars:
volume: "{{ item.item.1.split(':')[0] }}"