
This fix adds a check of Rabbitmq's image version during the upgrade. The container gets restarted only when the image version is different. Change-Id: Ie038845c0c8fff1ac51b7cbf21e1b593229c2c0e Closes-Bug: #1558832
38 lines
1.1 KiB
YAML
38 lines
1.1 KiB
YAML
---
|
|
- name: Checking if rabbitmq container needs upgrading
|
|
kolla_docker:
|
|
action: "compare_image"
|
|
common_options: "{{ docker_common_options }}"
|
|
name: "rabbitmq"
|
|
image: "{{ rabbitmq_image_full }}"
|
|
when: inventory_hostname in groups['rabbitmq']
|
|
register: rabbitmq_differs
|
|
|
|
- include: config.yml
|
|
|
|
- name: Find gospel node
|
|
command: docker exec -t rabbitmq /usr/local/bin/rabbitmq_get_gospel_node
|
|
changed_when: "{{ (gospel_node.stdout | from_json).changed }}"
|
|
failed_when: "{{ (gospel_node.stdout | from_json).failed }}"
|
|
register: gospel_node
|
|
run_once: True
|
|
|
|
- name: Stopping non-gospel nodes
|
|
kolla_docker:
|
|
action: "stop_container"
|
|
common_options: "{{ docker_common_options }}"
|
|
name: "rabbitmq"
|
|
when:
|
|
- rabbitmq_hostname != (gospel_node.stdout | from_json).hostname
|
|
- rabbitmq_differs['result']
|
|
|
|
- include: start.yml
|
|
when:
|
|
- rabbitmq_hostname == (gospel_node.stdout | from_json).hostname
|
|
- rabbitmq_differs['result']
|
|
|
|
- include: start.yml
|
|
when:
|
|
- rabbitmq_hostname != (gospel_node.stdout | from_json).hostname
|
|
- rabbitmq_differs['result']
|