kolla-ansible/ansible/roles/cyborg/handlers/main.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

52 lines
1.7 KiB
YAML

---
- name: Restart cyborg-api container
vars:
service_name: "cyborg-api"
service: "{{ cyborg_services[service_name] }}"
become: true
kolla_docker:
action: "recreate_or_restart_container"
common_options: "{{ docker_common_options }}"
name: "{{ service.container_name }}"
image: "{{ service.image }}"
privileged: "{{ service.privileged | default(False) }}"
volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}"
healthcheck: "{{ service.healthcheck | default(omit) }}"
when:
- kolla_action != "config"
- name: Restart cyborg-conductor container
vars:
service_name: "cyborg-conductor"
service: "{{ cyborg_services[service_name] }}"
become: true
kolla_docker:
action: "recreate_or_restart_container"
common_options: "{{ docker_common_options }}"
name: "{{ service.container_name }}"
image: "{{ service.image }}"
privileged: "{{ service.privileged | default(False) }}"
volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}"
healthcheck: "{{ service.healthcheck | default(omit) }}"
when:
- kolla_action != "config"
- name: Restart cyborg-agent container
vars:
service_name: "cyborg-agent"
service: "{{ cyborg_services[service_name] }}"
become: true
kolla_docker:
action: "recreate_or_restart_container"
common_options: "{{ docker_common_options }}"
name: "{{ service.container_name }}"
image: "{{ service.image }}"
privileged: "{{ service.privileged | default(False) }}"
volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}"
healthcheck: "{{ service.healthcheck | default(omit) }}"
when:
- kolla_action != "config"