kayobe/ansible/roles/docker-registry/tasks/deploy.yml
Mark Goddard 7d7dc486a4 Fix destroy of opensm and docker-registry containers
Now also removes docker volumes
2017-08-22 15:12:05 +00:00

14 lines
631 B
YAML

---
- name: Ensure Docker registry container is running
docker_container:
image: "{{ item.value.image }}"
name: "{{ item.value.container_name }}"
ports: "{{ item.value.ports | default(omit) }}"
privileged: "{{ item.value.privileged | default(omit) }}"
read_only: "{{ item.value.read_only | default(omit) }}"
restart_policy: "{{ docker_registry_restart_policy }}"
restart_retries: "{{ docker_registry_restart_retries }}"
state: "{{ (item.value.enabled and action != 'destroy') | ternary('started', 'absent') }}"
volumes: "{{ item.value.volumes }}"
with_dict: "{{ docker_registry_services }}"