kolla-ansible/ansible/roles/rabbitmq/tasks/upgrade.yml
Jeffrey Zhang b51eeed89e Use include_tasks instead of include
include is marked as deprecated since ansible 2.4[0]

[0] https://docs.ansible.com/ansible/2.4/include_module.html#deprecated

Co-Authored-By: confi-surya <singh.surya64mnnit@gmail.com>
Change-Id: Ic9d71e1865d1c728890625aeddf424a5734c0a8a
2018-07-25 23:57:22 +08:00

46 lines
1.3 KiB
YAML

---
- 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: Find gospel node
command: docker exec -t {{ project_name }} /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
become: true
kolla_docker:
action: "stop_container"
common_options: "{{ docker_common_options }}"
name: "{{ project_name }}"
when:
- rabbitmq_hostname != (gospel_node.stdout | from_json).hostname
- rabbitmq_differs['result']
- name: Flush handlers
meta: flush_handlers
when:
- rabbitmq_hostname == (gospel_node.stdout | from_json).hostname
- rabbitmq_differs['result']
- name: Flush handlers
meta: flush_handlers
when:
- rabbitmq_hostname != (gospel_node.stdout | from_json).hostname
- rabbitmq_differs['result']