kolla-ansible/ansible/roles/grafana/handlers/main.yml
Mauricio Lima 43813b8a6d Optimize reconfiguration for grafana
Change-Id: I672d6fea935cbe7416ebd0cfff5006fddb9cd534
Partially-implements: blueprint better-reconfigure
2017-01-25 10:35:34 -03:00

22 lines
898 B
YAML

---
- name: Restart grafana container
vars:
service_name: "grafana"
service: "{{ grafana_services[service_name] }}"
config_json: "{{ grafana_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
grafana_conf: "{{ grafana_confs.results|selectattr('item.key', 'equalto', service_name)|first }}"
grafana_container: "{{ check_grafana_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:
- action != "config"
- inventory_hostname in groups[service.group]
- service.enabled | bool
- config_json.changed | bool
or grafana_ini.changed | bool
or grafana_container.changed | bool