diff options
author | Larry Smith Jr <mrlesmithjr@gmail.com> | 2016-12-03 17:51:25 -0500 |
---|---|---|
committer | Larry Smith Jr <mrlesmithjr@gmail.com> | 2016-12-03 17:51:25 -0500 |
commit | 109c6b750751d1c5cd216ad2f09258cf512c4c9e (patch) | |
tree | 0b276b62a25937dd5edb6d905952cf107b7c88ca /Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_ha_config.yml | |
parent | 8f8673fb8dfa2bd4fa2694cbfdcb6eed54e502de (diff) | |
download | ansible-rabbitmq-109c6b750751d1c5cd216ad2f09258cf512c4c9e.tar.gz ansible-rabbitmq-109c6b750751d1c5cd216ad2f09258cf512c4c9e.tar.zst ansible-rabbitmq-109c6b750751d1c5cd216ad2f09258cf512c4c9e.zip |
Addressed issue #6
Signed-off-by: Larry Smith Jr <mrlesmithjr@gmail.com>
Diffstat (limited to 'Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_ha_config.yml')
-rw-r--r-- | Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_ha_config.yml | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_ha_config.yml b/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_ha_config.yml new file mode 100644 index 0000000..8811b6d --- /dev/null +++ b/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_ha_config.yml | |||
@@ -0,0 +1,44 @@ | |||
1 | --- | ||
2 | - name: rabbitmq_ha_config | checking if rabbitmqadmin is installed | ||
3 | stat: | ||
4 | path: /usr/sbin/rabbitmqadmin | ||
5 | register: rabbitmqadmin_check | ||
6 | |||
7 | - name: rabbitmq_ha_config | install rabbitMQ admin | ||
8 | shell: wget http://guest:guest@localhost:15672/cli/rabbitmqadmin | ||
9 | when: not rabbitmqadmin_check.stat.exists | ||
10 | |||
11 | - name: rabbitmq_ha_config | moving the rabbitMQ Admin | ||
12 | shell: mv rabbitmqadmin /usr/sbin | ||
13 | when: not rabbitmqadmin_check.stat.exists | ||
14 | |||
15 | - name: rabbitmq_ha_config | making executable rabbitMQ Admin | ||
16 | shell: chmod +x /usr/sbin/rabbitmqadmin | ||
17 | notify: restart rabbitmq-server | ||
18 | when: not rabbitmqadmin_check.stat.exists | ||
19 | |||
20 | - name: rabbitmq_ha_config | creating queue(s) | ||
21 | command: rabbitmqadmin declare queue name={{ item.queue_name }} durable={{ item.durable|lower }} | ||
22 | run_once: true | ||
23 | with_items: "{{ rabbitmq_config }}" | ||
24 | |||
25 | - name: rabbitmq_ha_config | setting up ha on queue(s) | ||
26 | rabbitmq_policy: | ||
27 | name: "ha-all" | ||
28 | pattern: "{{ item.queue_name }}" | ||
29 | tags: "{{ item.tags }}" | ||
30 | state: present | ||
31 | run_once: true | ||
32 | with_items: "{{ rabbitmq_config }}" | ||
33 | |||
34 | - name: rabbitmq_ha_config | creating exchange(s) | ||
35 | command: rabbitmqadmin declare exchange name={{ item.exchange_name }} type={{ item.type }} | ||
36 | run_once: true | ||
37 | with_items: "{{ rabbitmq_config }}" | ||
38 | when: item.exchange_name is defined | ||
39 | |||
40 | - name: rabbitmq_ha_config | creating binding(s) | ||
41 | command: rabbitmqadmin declare binding source={{ item.exchange_name }} destination_type="queue" destination={{ item.queue_name }} routing_key={{ item.routing_key }} | ||
42 | run_once: true | ||
43 | with_items: "{{ rabbitmq_config }}" | ||
44 | when: item.exchange_name is defined | ||