kolla-ansible/ansible/roles/grafana/tasks/upgrade.yml
Michal Nasiadka dcf5a8b65f Fix var-spacing
ansible-lint introduced var-spacing - let's fix our code.

Change-Id: I0d8aaf3c522a5a6a5495032f6dbed8a2be0251f0
2022-07-25 22:15:15 +02:00

34 lines
993 B
YAML

---
- name: Checking if Grafana container needs upgrading
vars:
service_name: "grafana"
service: "{{ grafana_services[service_name] }}"
become: true
kolla_docker:
action: "compare_image"
common_options: "{{ docker_common_options }}"
name: "{{ project_name }}"
image: "{{ grafana_image_full }}"
when: inventory_hostname in groups['grafana']
register: grafana_differs
- import_tasks: config.yml
- import_tasks: check-containers.yml
# NOTE(dszumski): We don't want old Grafana instances running after
# a new instance has updated the DB schema. Since the first instance
# is upgraded first, we stop all the other ones.
- name: Stopping all Grafana instances but the first node
become: true
kolla_docker:
action: "stop_container"
common_options: "{{ docker_common_options }}"
name: "{{ project_name }}"
when:
- inventory_hostname != groups['grafana'] | first
- grafana_differs['result']
- name: Flush handlers
meta: flush_handlers