kolla-ansible/ansible/roles/glance/handlers/main.yml
Jeffrey Zhang d37da2cfa9 Optimize reconfigure action for glance
Partically-implements: blueprint better-reconfigure
Change-Id: I89e30e8b87f24a621c521d915842a4af0042d6fe
2017-01-02 10:58:43 +08:00

47 lines
2.0 KiB
YAML

---
- name: Restart glance-api container
vars:
service_name: "glance-api"
service: "{{ glance_services[service_name] }}"
config_json: "{{ glance_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
glance_conf: "{{ glance_confs.results|selectattr('item.key', 'equalto', service_name)|first }}"
policy_json: "{{ glance_policy_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
glance_api_container: "{{ check_glance_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
kolla_docker:
action: "recreate_or_restart_container"
common_options: "{{ docker_common_options }}"
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
when:
- inventory_hostname in groups[service.group]
- service.enabled | bool
- config_json.changed | bool
or glance_conf.changed | bool
or policy_json.changed | bool
or glance_api_container.changed | bool
- name: Restart glance-registry container
vars:
service_name: "glance-registry"
service: "{{ glance_services[service_name] }}"
config_json: "{{ glance_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
glance_conf: "{{ glance_confs.results|selectattr('item.key', 'equalto', service_name)|first }}"
policy_json: "{{ glance_policy_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
glance_registry_container: "{{ check_glance_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
kolla_docker:
action: "recreate_or_restart_container"
common_options: "{{ docker_common_options }}"
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
when:
- inventory_hostname in groups[service.group]
- service.enabled | bool
- config_json.changed | bool
or glance_conf.changed | bool
or policy_json.changed | bool
or glance_registry_container.changed | bool