kolla-ansible/ansible/roles/etcd/tasks/config.yml
Mauricio Lima b155ad5d96 Optimize reconfiguration for etcd
Co-Authored-By: caoyuan <cao.yuan@99cloud.net>
Change-Id: I1cd494afd3a76e832272e70e9e1e5a41a522a31e
Partially-implements: blueprint better-reconfigure
2017-02-06 23:01:09 +08:00

39 lines
1.1 KiB
YAML

---
- name: Ensuring config directories exist
file:
path: "{{ node_config_directory }}/{{ item.key }}"
state: "directory"
recurse: yes
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ etcd_services }}"
- name: Copying over config.json files for services
template:
src: "{{ item.key }}.json.j2"
dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
register: etcd_config_jsons
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ etcd_services }}"
notify:
- Restart etcd container
- name: Check etcd containers
kolla_docker:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
register: check_etcd_containers
when:
- action != "config"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ etcd_services }}"
notify:
- Restart etcd container