From 36d43c5d55774bb5141fc7d61dcc14d769895a45 Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Fri, 22 Mar 2019 20:26:30 +0000 Subject: [PATCH] rabbitmq_cluster: Create the zmq.topic and bind it to amq.topic This way amq.topic in the public vhost gets all messages. Signed-off-by: Jeremy Cline --- roles/rabbitmq_cluster/tasks/main.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/roles/rabbitmq_cluster/tasks/main.yml b/roles/rabbitmq_cluster/tasks/main.yml index d590ff0b5b..5e6e6b77f1 100644 --- a/roles/rabbitmq_cluster/tasks/main.yml +++ b/roles/rabbitmq_cluster/tasks/main.yml @@ -192,6 +192,28 @@ - rabbitmq_cluster - config +- name: Create the zmq.topic exchange in /public_pubsub + run_once: true + delegate_to: "rabbitmq01{{ env_suffix }}.phx2.fedoraproject.org" + rabbitmq_exchange: + name: "zmq.topic" + vhost: "/public_pubsub" + login_user: admin + login_password: "{{ (env == 'production')|ternary(rabbitmq_admin_password_production, rabbitmq_admin_password_staging) }}" + +# We keep them separated in /pubsub so we can bridge messages back to zmq +- name: Forward all zmq.topic to amq.topic in the public_pubsub vhost + run_once: true + delegate_to: "rabbitmq01{{ env_suffix }}.phx2.fedoraproject.org" + rabbitmq_binding: + destination_type: exchange + name: zmq.topic + dest: amq.topic + routing_key: "#" + vhost: "/public_pubsub" + login_user: admin + login_password: "{{ (env == 'production')|ternary(rabbitmq_admin_password_production, rabbitmq_admin_password_staging) }}" + - name: Configure a policy to ensure the public vhost stays swept up and tidy run_once: true delegate_to: "rabbitmq01{{ env_suffix }}.phx2.fedoraproject.org"