kolla-ansible/ansible/roles/rabbitmq/tasks/upgrade.yml
Paul Bourke b163cb02d1 Update rabbitmq to use new conf & clustering
Depends-On: I75e00312b36e1678b90a42cf58d24652323eff27
Change-Id: Ia716fabffca41eff816e59bbf9f4cab79ee8b72f
2018-09-21 16:47:59 +00:00

43 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
- include_tasks: config.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