Files
kayobe/ansible/roles/node-exporter/tasks/destroy.yml
Jon Davies a19501a174 Added Prometheus node exporter role (#34)
* Added roles/node-exporter.

* node-exporter.yml: Deploy on all overcloud hosts.

* node-exporter: deploy: Use command variable.

* node-exporter: README: Fixed role name.

* node-exporter: Do not enable by default.
2017-10-26 14:39:26 +01:00

26 lines
660 B
YAML

---
- include: deploy.yml
- name: Check whether Node Exporter volumes are present
command: docker volume inspect {{ volume }}
changed_when: False
with_subelements:
- "{{ nodeexporter_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 Node Exporter 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] }}"