kolla-ansible/ansible/roles/grafana/tasks/upgrade.yml
Radosław Piliszek 3411b9e420 Performance: optimize genconfig
Config plays do not need to check containers. This avoids skipping
tasks during the genconfig action.

Ironic and Glance rolling upgrades are handled specially.

Swift and Bifrost do not use the handlers at all.

Partially-Implements: blueprint performance-improvements
Change-Id: I140bf71d62e8f0932c96270d1f08940a5ba4542a
2020-10-12 19:30:06 +02:00

34 lines
991 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