kolla-ansible/ansible/roles/cyborg/tasks/check-containers.yml
wuchunyang 6973c71a60 Use Docker healthchecks for cyborg services
This change enables the use of Docker healthchecks for cyborg
services.
Implements: blueprint container-health-check

Change-Id: I5326b142eaa826f97c32498cd2a9a0cba65be698
2021-03-03 11:10:39 +00:00

19 lines
621 B
YAML

---
- name: Check cyborg containers
become: true
kolla_docker:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ cyborg_services }}"
notify:
- Restart {{ item.key }} container