kolla-ansible/ansible/roles/rabbitmq/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

45 lines
1.4 KiB
YAML

---
# NOTE(pbourke): These tasks perform a 'full stop upgrade', which is necessary when moving between
# major releases. In future kolla-ansible releases we may be able to change this to a rolling
# restart. For info on this process see https://www.rabbitmq.com/upgrade.html
- name: Checking if rabbitmq container needs upgrading
vars:
service_name: "rabbitmq"
service: "{{ rabbitmq_services[service_name] }}"
become: true
kolla_docker:
action: "compare_image"
common_options: "{{ docker_common_options }}"
name: "{{ project_name }}"
image: "{{ rabbitmq_image_full }}"
environment: "{{ service.environment }}"
when: inventory_hostname in groups[role_rabbitmq_groups]
register: rabbitmq_differs
- import_tasks: config.yml
- import_tasks: check-containers.yml
- name: Stopping all rabbitmq instances but the first node
become: true
kolla_docker:
action: "stop_container"
common_options: "{{ docker_common_options }}"
name: "{{ project_name }}"
when:
- inventory_hostname != groups[role_rabbitmq_groups]|first
- rabbitmq_differs['result']
- name: Stopping rabbitmq on the first node
become: true
kolla_docker:
action: "stop_container"
common_options: "{{ docker_common_options }}"
name: "{{ project_name }}"
when:
- inventory_hostname == groups[role_rabbitmq_groups]|first
- rabbitmq_differs['result']
- name: Flush handlers
meta: flush_handlers