aboutsummaryrefslogtreecommitdiffhomepage
path: root/tasks/rabbitmq_ha_config.yml
diff options
context:
space:
mode:
authorLarry Smith Jr <mrlesmithjr@gmail.com>2018-12-20 14:58:48 -0500
committerGitHub <noreply@github.com>2018-12-20 14:58:48 -0500
commitba3197ed9f9a1ddbb2acb9735449fac47c559e18 (patch)
tree04b37cd175796159cc9dadd7fb69f50a60214f4b /tasks/rabbitmq_ha_config.yml
parent4352e35b29e9fcc0b0e3440e00e8ece4fd9b4348 (diff)
parentfa6c482bae5ea36e52b575281feeab2649a8321f (diff)
downloadansible-rabbitmq-ba3197ed9f9a1ddbb2acb9735449fac47c559e18.tar.gz
ansible-rabbitmq-ba3197ed9f9a1ddbb2acb9735449fac47c559e18.tar.zst
ansible-rabbitmq-ba3197ed9f9a1ddbb2acb9735449fac47c559e18.zip
Merge pull request #23 from paulrbr-fl/clustering-admin-tasks
clustering: make sure to delegate admin tasks to the master node
Diffstat (limited to 'tasks/rabbitmq_ha_config.yml')
-rw-r--r--tasks/rabbitmq_ha_config.yml18
1 files changed, 11 insertions, 7 deletions
diff --git a/tasks/rabbitmq_ha_config.yml b/tasks/rabbitmq_ha_config.yml
index cea301c..322172d 100644
--- a/tasks/rabbitmq_ha_config.yml
+++ b/tasks/rabbitmq_ha_config.yml
@@ -13,9 +13,18 @@
13 notify: restart rabbitmq-server 13 notify: restart rabbitmq-server
14 when: not rabbitmqadmin_check['stat']['exists'] 14 when: not rabbitmqadmin_check['stat']['exists']
15 15
16- name: rabbitmq_ha_config | creating exchange(s)
17 command: rabbitmqadmin declare exchange name={{ item['exchange_name'] }} type={{ item['type'] }} --vhost={{ item['vhost'] | default('/') }}
18 run_once: true
19 delegate_to: "{{ rabbitmq_master }}"
20 become: true
21 with_items: "{{ rabbitmq_config }}"
22 when: item['exchange_name'] is defined
23
16- name: rabbitmq_ha_config | creating queue(s) 24- name: rabbitmq_ha_config | creating queue(s)
17 command: rabbitmqadmin declare queue name={{ item['queue_name'] }} durable={{ item['durable']|lower }} --vhost={{ item['vhost'] | default('/') }} 25 command: rabbitmqadmin declare queue name={{ item['queue_name'] }} durable={{ item['durable']|lower }} --vhost={{ item['vhost'] | default('/') }}
18 run_once: true 26 run_once: true
27 delegate_to: "{{ rabbitmq_master }}"
19 become: true 28 become: true
20 when: 29 when:
21 - item['queue_name'] is defined 30 - item['queue_name'] is defined
@@ -32,20 +41,15 @@
32 policy_vhost: "{{ item.vhost | default('/') }}" 41 policy_vhost: "{{ item.vhost | default('/') }}"
33 policy_name: "{{ item.policy_pattern is defined | ternary(policy_vhost + item.policy_pattern|default(''),item.queue_name|default('')) }}" 42 policy_name: "{{ item.policy_pattern is defined | ternary(policy_vhost + item.policy_pattern|default(''),item.queue_name|default('')) }}"
34 run_once: true 43 run_once: true
44 delegate_to: "{{ rabbitmq_master }}"
35 become: true 45 become: true
36 when: item.queue_name is defined or item.policy_pattern is defined 46 when: item.queue_name is defined or item.policy_pattern is defined
37 with_items: "{{ rabbitmq_config }}" 47 with_items: "{{ rabbitmq_config }}"
38 48
39- name: rabbitmq_ha_config | creating exchange(s)
40 command: rabbitmqadmin declare exchange name={{ item['exchange_name'] }} type={{ item['type'] }} --vhost={{ item['vhost'] | default('/') }}
41 run_once: true
42 become: true
43 with_items: "{{ rabbitmq_config }}"
44 when: item['exchange_name'] is defined
45
46- name: rabbitmq_ha_config | creating binding(s) 49- name: rabbitmq_ha_config | creating binding(s)
47 command: rabbitmqadmin declare binding source={{ item['exchange_name'] }} destination_type="queue" destination={{ item['queue_name'] }} routing_key={{ item['routing_key'] }} --vhost={{ item['vhost'] | default('/') }} 50 command: rabbitmqadmin declare binding source={{ item['exchange_name'] }} destination_type="queue" destination={{ item['queue_name'] }} routing_key={{ item['routing_key'] }} --vhost={{ item['vhost'] | default('/') }}
48 run_once: true 51 run_once: true
52 delegate_to: "{{ rabbitmq_master }}"
49 become: true 53 become: true
50 with_items: "{{ rabbitmq_config }}" 54 with_items: "{{ rabbitmq_config }}"
51 when: item['exchange_name'] is defined 55 when: item['exchange_name'] is defined