]> git.immae.eu Git - github/fretlink/ansible-rabbitmq.git/commitdiff
add vhost for exchange and queue declaration 2/head
authorGaëtan Duchaussois <gaetan.duchaussois@fretlink.com>
Tue, 18 Dec 2018 15:13:25 +0000 (16:13 +0100)
committerGaëtan Duchaussois <gaetan.duchaussois@fretlink.com>
Tue, 18 Dec 2018 15:13:25 +0000 (16:13 +0100)
tasks/rabbitmq_ha_config.yml

index bf74957c06f5f8dea618b33aa000b48e63f299fd..ffda6e9b76c0e60bc5651ef7383110619e954c1f 100644 (file)
@@ -21,7 +21,7 @@
   when: not rabbitmqadmin_check['stat']['exists']
 
 - name: rabbitmq_ha_config | creating queue(s)
-  command: rabbitmqadmin declare queue name={{ item['queue_name'] }} durable={{ item['durable']|lower }}
+  command: rabbitmqadmin declare queue name={{ item['queue_name'] }} durable={{ item['durable']|lower }} --vhost={{ item['vhost'] | default('/') }}
   run_once: true
   become: true
   with_items: "{{ rabbitmq_config }}"
   with_items: "{{ rabbitmq_config }}"
 
 - name: rabbitmq_ha_config | creating exchange(s)
-  command: rabbitmqadmin declare exchange name={{ item['exchange_name'] }} type={{ item['type'] }}
+  command: rabbitmqadmin declare exchange name={{ item['exchange_name'] }} type={{ item['type'] }} --vhost={{ item['vhost'] | default('/') }}
   run_once: true
   become: true
   with_items: "{{ rabbitmq_config }}"
   when: item['exchange_name'] is defined
 
 - name: rabbitmq_ha_config | creating binding(s)
-  command: rabbitmqadmin declare binding source={{ item['exchange_name'] }} destination_type="queue" destination={{ item['queue_name'] }} routing_key={{ item['routing_key'] }}
+  command: rabbitmqadmin declare binding source={{ item['exchange_name'] }} destination_type="queue" destination={{ item['queue_name'] }} routing_key={{ item['routing_key'] }} --vhost={{ item['vhost'] | default('/') }}
   run_once: true
   become: true
   with_items: "{{ rabbitmq_config }}"