X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tasks%2Frabbitmq_ha_config.yml;h=cea301ccfd431301870c98c8e8647784c865c177;hb=ee7f4e7c0750e17853d1d0364c92ebd4caaea4b0;hp=e62fc83301cbcbf038cc0a4af85836da2de5db69;hpb=2cf614d413be9c9f4948e034b6ec421a5964c00a;p=github%2Ffretlink%2Fansible-rabbitmq.git diff --git a/tasks/rabbitmq_ha_config.yml b/tasks/rabbitmq_ha_config.yml index e62fc83..cea301c 100644 --- a/tasks/rabbitmq_ha_config.yml +++ b/tasks/rabbitmq_ha_config.yml @@ -4,24 +4,17 @@ path: /usr/sbin/rabbitmqadmin register: rabbitmqadmin_check -- name: rabbitmq_ha_config | install rabbitMQ admin - shell: wget http://guest:guest@localhost:15672/cli/rabbitmqadmin +- name: rabbit_ha_config | Installing rabbitMQ admin + get_url: + url: http://guest:guest@localhost:15672/cli/rabbitmqadmin + dest: /usr/sbin/rabbitmqadmin + mode: u=rwx,g=rw,o=rw become: true - when: not rabbitmqadmin_check['stat']['exists'] - -- name: rabbitmq_ha_config | moving the rabbitMQ Admin - shell: mv rabbitmqadmin /usr/sbin - become: true - when: not rabbitmqadmin_check['stat']['exists'] - -- name: rabbitmq_ha_config | making executable rabbitMQ Admin - shell: chmod +x /usr/sbin/rabbitmqadmin notify: restart rabbitmq-server - become: true 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 when: @@ -44,14 +37,14 @@ 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 }}"