Merge pull request #87 from markgoddard/destroy-extra-containers

Use a separate task to destroy node exporter, opensm and docker registry containers
This commit is contained in:
Mark Goddard 2017-11-30 13:11:29 +00:00 committed by GitHub
commit ef3c1c069f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 6 deletions

View File

@ -8,6 +8,6 @@
read_only: "{{ item.value.read_only | default(omit) }}"
restart_policy: "{{ docker_registry_restart_policy }}"
restart_retries: "{{ docker_registry_restart_retries | default(omit) }}"
state: "{{ (item.value.enabled and action != 'destroy') | ternary('started', 'absent') }}"
state: "{{ item.value.enabled | ternary('started', 'absent') }}"
volumes: "{{ item.value.volumes }}"
with_dict: "{{ docker_registry_services }}"

View File

@ -1,5 +1,9 @@
---
- include: deploy.yml
- name: Ensure docker registry container is stopped
docker_container:
name: "{{ item.value.container_name }}"
state: "absent"
with_dict: "{{ docker_registry_services }}"
- name: Check whether docker registry volumes are present
command: docker volume inspect {{ volume }}

View File

@ -9,6 +9,6 @@
read_only: "{{ item.value.read_only | default(omit) }}"
restart_policy: "{{ nodeexporter_restart_policy }}"
restart_retries: "{{ nodeexporter_restart_retries | default(omit) }}"
state: "{{ (item.value.enabled and action != 'destroy') | ternary('started', 'absent') }}"
state: "{{ item.value.enabled | ternary('started', 'absent') }}"
volumes: "{{ item.value.volumes }}"
with_dict: "{{ nodeexporter_services }}"

View File

@ -1,5 +1,9 @@
---
- include: deploy.yml
- name: Ensure node exporter container is stopped
docker_container:
name: "{{ item.value.container_name }}"
state: "absent"
with_dict: "{{ nodeexporter_services }}"
- name: Check whether Node Exporter volumes are present
command: docker volume inspect {{ volume }}

View File

@ -8,6 +8,6 @@
read_only: "{{ item.value.read_only | default(omit) }}"
restart_policy: "{{ opensm_restart_policy }}"
restart_retries: "{{ opensm_restart_retries | default(omit) }}"
state: "{{ (item.value.enabled and action != 'destroy') | ternary('started', 'absent') }}"
state: "{{ item.value.enabled | ternary('started', 'absent') }}"
volumes: "{{ item.value.volumes }}"
with_dict: "{{ opensm_services }}"

View File

@ -1,5 +1,9 @@
---
- include: deploy.yml
- name: Ensure OpenSM container is stopped
docker_container:
name: "{{ item.value.container_name }}"
state: "absent"
with_dict: "{{ opensm_services }}"
- name: Check whether OpenSM volumes are present
command: docker volume inspect {{ volume }}