Restart after plugins or policies have changed
To avoid every run of the role causing a restart of rabbitmq services, move the restart task until after the tasks for configuring plugins and policies so that 'rabbitmq_plugin' and 'rabbitmq_policy' are registered. Change-Id: If7aeeab81a2b8dc722d460b1dba8e65f63285b10
This commit is contained in:
parent
db4834d9c7
commit
2f6e503664
|
@ -24,7 +24,7 @@
|
||||||
- rabbitmq-config
|
- rabbitmq-config
|
||||||
|
|
||||||
- name: Create rabbitmq config
|
- name: Create rabbitmq config
|
||||||
register: rabbit_config_changed
|
register: rabbit_config
|
||||||
template:
|
template:
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
dest: "{{ item.dest }}"
|
dest: "{{ item.dest }}"
|
||||||
|
@ -62,10 +62,6 @@
|
||||||
# don't trigger ANSIBLE0016
|
# don't trigger ANSIBLE0016
|
||||||
- skip_ansible_lint
|
- skip_ansible_lint
|
||||||
|
|
||||||
- include: rabbitmq_restart.yml
|
|
||||||
static: no
|
|
||||||
when: rabbit_config_changed|changed or rabbitmq_plugin|changed or rabbitmq_queue_mirror|changed
|
|
||||||
|
|
||||||
- name: Configure rabbitmq plugins
|
- name: Configure rabbitmq plugins
|
||||||
rabbitmq_plugin:
|
rabbitmq_plugin:
|
||||||
names: "{{ item.name }}"
|
names: "{{ item.name }}"
|
||||||
|
@ -82,12 +78,16 @@
|
||||||
pattern: "{{ item.pattern }}"
|
pattern: "{{ item.pattern }}"
|
||||||
priority: "{{ item.priority | default(0) }}"
|
priority: "{{ item.priority | default(0) }}"
|
||||||
tags: "{{ item.tags }}"
|
tags: "{{ item.tags }}"
|
||||||
register: rabbitmq_queue_mirror
|
register: rabbitmq_policy
|
||||||
with_items: "{{ rabbitmq_policies }}"
|
with_items: "{{ rabbitmq_policies }}"
|
||||||
tags:
|
tags:
|
||||||
- rabbitmq-config
|
- rabbitmq-config
|
||||||
- rabbitmq-cluster
|
- rabbitmq-cluster
|
||||||
|
|
||||||
|
- include: rabbitmq_restart.yml
|
||||||
|
static: no
|
||||||
|
when: rabbit_config|changed or rabbitmq_plugin|changed or rabbitmq_policy|changed
|
||||||
|
|
||||||
# This is being done because the rabbitctl command used by the module
|
# This is being done because the rabbitctl command used by the module
|
||||||
# is not very effective at returning proper status codes for failure
|
# is not very effective at returning proper status codes for failure
|
||||||
# and the module does not error detection. until we can go upstream
|
# and the module does not error detection. until we can go upstream
|
||||||
|
|
Loading…
Reference in New Issue