kolla-ansible/ansible/roles/etcd/handlers/main.yml
Mark Goddard ee7a29cf00 Remove compute hosts from etcd group
Since I701d495675178c3ed8ec1f00b31d09f198b38a6f merged, etcd only runs
on the control hosts, not the compute hosts. We therefore no longer
require the etcd group to include the compute hosts.

Since the group mapping is now static, we can remove the use of
host_in_groups from the etcd service, in favour of the simpler method of
specifying the group.

Change-Id: Id8f888d7321a30a85ff95e742f7e6c8e2b9c696f
Related-Bug: #1790415
2018-09-04 19:23:18 +01:00

23 lines
848 B
YAML

---
- name: Restart etcd container
vars:
service_name: "etcd"
service: "{{ etcd_services[service_name] }}"
config_json: "{{ etcd_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
etcd_container: "{{ check_etcd_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
become: true
kolla_docker:
action: "recreate_or_restart_container"
common_options: "{{ docker_common_options }}"
name: "{{ service.container_name }}"
image: "{{ service.image }}"
environment: "{{ service.environment }}"
volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- service.enabled | bool
- inventory_hostname in groups[service.group]
- config_json.changed | bool
or etcd_container.changed | bool