From 2df32fbe0c880ac032bcb5dac9199fe8a01cc199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Fri, 14 Feb 2020 14:14:40 +0100 Subject: [PATCH] RabbitMQ: use the proper tags for the messaging-bridges playbook --- .../openshift-apps/messaging-bridges.yml | 73 ++++++------------- 1 file changed, 23 insertions(+), 50 deletions(-) diff --git a/playbooks/openshift-apps/messaging-bridges.yml b/playbooks/openshift-apps/messaging-bridges.yml index df19b180be..bcb2966f9d 100644 --- a/playbooks/openshift-apps/messaging-bridges.yml +++ b/playbooks/openshift-apps/messaging-bridges.yml @@ -20,18 +20,8 @@ configure_priv: "^$" tags: - config - - name: Create the RabbitMQ exchanges - rabbitmq_exchange: - name: "{{item}}" - exchange_type: topic - vhost: /pubsub - login_user: admin - login_password: "{{ (env == 'production')|ternary(rabbitmq_admin_password_production, rabbitmq_admin_password_staging) }}" - with_items: - - amq.topic - - zmq.topic - tags: - - config + - rabbitmq_cluster + - name: Create the RabbitMQ queue amqp_to_zmq rabbitmq_queue: name: amqp_to_zmq @@ -40,6 +30,8 @@ login_password: "{{ (env == 'production')|ternary(rabbitmq_admin_password_production, rabbitmq_admin_password_staging) }}" tags: - config + - rabbitmq_cluster + - name: Create the RabbitMQ queue for verify-missing rabbitmq_queue: name: amqp_bridge_verify_missing @@ -51,53 +43,34 @@ login_password: "{{ (env == 'production')|ternary(rabbitmq_admin_password_production, rabbitmq_admin_password_staging) }}" tags: - config - # Do this manually until an Ansible bugfix is deployed - # https://github.com/ansible/ansible/pull/45109 - # - # == Dirty manual way while bug 45109 isn't fixed - - name: Get the rabbitmqadmin command - get_url: - url: http://localhost:15672/cli/rabbitmqadmin - dest: /usr/local/bin/rabbitmqadmin - mode: 0755 - tags: - - config + - rabbitmq_cluster + - name: Create the amqp-to-zmq bindings - command: /usr/local/bin/rabbitmqadmin -V /pubsub -u admin -p {{ (env == 'production')|ternary(rabbitmq_admin_password_production, rabbitmq_admin_password_staging) }} declare binding source=amq.topic destination=amqp_to_zmq destination_type=queue + rabbitmq_binding: + name: amq.topic + destination: amqp_to_zmq + destination_type: queue + vhost: /pubsub + login_user: admin + login_password: "{{ (env == 'production')|ternary(rabbitmq_admin_password_production, rabbitmq_admin_password_staging) }}" tags: - config + - rabbitmq_cluster + - name: Create the verify-missing bindings - command: /usr/local/bin/rabbitmqadmin -V /pubsub -u admin -p {{ (env == 'production')|ternary(rabbitmq_admin_password_production, rabbitmq_admin_password_staging) }} declare binding source={{ item }} destination=amqp_bridge_verify_missing destination_type=queue + rabbitmq_binding: + name: "{{item}}" + destination: amqp_bridge_verify_missing + destination_type: queue + vhost: /pubsub + login_user: admin + login_password: "{{ (env == 'production')|ternary(rabbitmq_admin_password_production, rabbitmq_admin_password_staging) }}" with_items: - amq.topic - zmq.topic tags: - config - # - # == Proper ansible way of doing it - #- name: Create the amqp-to-zmq bindings - # rabbitmq_binding: - # source: amq.topic - # destination: amqp_to_zmq - # destination_type: queue - # vhost: /pubsub - # login_user: admin - # login_password: "{{ (env == 'production')|ternary(rabbitmq_admin_password_production, rabbitmq_admin_password_staging) }}" - # tags: - # - config - #- name: Create the verify-missing bindings - # rabbitmq_binding: - # source: "{{item}}" - # destination: amqp_bridge_verify_missing - # destination_type: queue - # vhost: /pubsub - # login_user: admin - # login_password: "{{ (env == 'production')|ternary(rabbitmq_admin_password_production, rabbitmq_admin_password_staging) }}" - # with_items: - # - amq.topic - # - zmq.topic - # tags: - # - config + - rabbitmq_cluster # Now create the app