diff --git a/roles/rabbitmq_cluster/tasks/main.yml b/roles/rabbitmq_cluster/tasks/main.yml index d92bc7c595..593b8728a3 100644 --- a/roles/rabbitmq_cluster/tasks/main.yml +++ b/roles/rabbitmq_cluster/tasks/main.yml @@ -136,7 +136,8 @@ # This is the publicly accessible virtual host - name: Configure the publicly accessible vhost run_once: true - delegate_to: "rabbitmq01{{ env_suffix }}.{{ datacenter }}.fedoraproject.org" + delegate_to: "rabbitmq01{{ env_suffix }}.{{ item }}.fedoraproject.org" + with_items: "{{ datacenter }}" rabbitmq_vhost: name: /public_pubsub state: present @@ -160,7 +161,8 @@ - name: Add a policy to limit queues to 1GB and remove after a month of no use run_once: true - delegate_to: "rabbitmq01{{ env_suffix }}.{{ datacenter }}.fedoraproject.org" + delegate_to: "rabbitmq01{{ env_suffix }}.{{ item }}.fedoraproject.org" + with_items: "{{ datacenter }}" rabbitmq_policy: apply_to: queues name: pubsub_sweeper @@ -257,7 +259,8 @@ - name: Create the zmq.topic exchange in the {{ item }} vhost run_once: true - delegate_to: "rabbitmq01{{ env_suffix }}.{{ datacenter }}.fedoraproject.org" + delegate_to: "rabbitmq01{{ env_suffix }}.{{ item }}.fedoraproject.org" + with_items: "{{ datacenter }}" rabbitmq_exchange: name: "zmq.topic" exchange_type: "topic" @@ -274,7 +277,8 @@ # 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 }}.{{ datacenter }}.fedoraproject.org" + delegate_to: "rabbitmq01{{ env_suffix }}.{{ item }}.fedoraproject.org" + with_items: "{{ datacenter }}" rabbitmq_binding: destination_type: exchange name: zmq.topic @@ -289,7 +293,8 @@ - name: Configure a policy to ensure the public vhost stays swept up and tidy run_once: true - delegate_to: "rabbitmq01{{ env_suffix }}.{{ datacenter }}.fedoraproject.org" + delegate_to: "rabbitmq01{{ env_suffix }}.{{ item }}.fedoraproject.org" + with_items: "{{ datacenter }}" rabbitmq_policy: apply_to: queues name: sweeper @@ -311,7 +316,8 @@ # read queues for consuming - name: Create a user for public access run_once: true - delegate_to: "rabbitmq01{{ env_suffix }}.{{ datacenter }}.fedoraproject.org" + delegate_to: "rabbitmq01{{ env_suffix }}.{{ item }}.fedoraproject.org" + with_items: "{{ datacenter }}" rabbitmq_user: user: "fedora{{ env_suffix }}" permissions: @@ -331,7 +337,8 @@ # exchange, create a queue, and bind a queue to an exchange. - name: Create a user for federation run_once: true - delegate_to: "rabbitmq01{{ env_suffix }}.{{ datacenter }}.fedoraproject.org" + delegate_to: "rabbitmq01{{ env_suffix }}.{{ item }}.fedoraproject.org" + with_items: "{{ datacenter }}" rabbitmq_user: user: pubsub_federation permissions: @@ -374,7 +381,8 @@ # choke up rabbitmq_parameters. - name: Configure federation upstream from pubsub to the public_pubsub vhost run_once: true - delegate_to: "rabbitmq01{{ env_suffix }}.{{ datacenter }}.fedoraproject.org" + delegate_to: "rabbitmq01{{ env_suffix }}.{{ item }}.fedoraproject.org" + with_items: "{{ datacenter }}" when: "env == 'staging'" rabbitmq_parameter: component: "federation-upstream" @@ -385,7 +393,8 @@ - name: Configure federation upstream from pubsub to the public_pubsub vhost (phx2) run_once: true - delegate_to: "rabbitmq01{{ env_suffix }}.{{ datacenter }}.fedoraproject.org" + delegate_to: "rabbitmq01{{ env_suffix }}.{{ item }}.fedoraproject.org" + with_items: "{{ datacenter }}" when: "env == 'production' and datacenter == 'phx2'" rabbitmq_parameter: component: "federation-upstream" @@ -396,7 +405,8 @@ - name: Configure federation upstream from pubsub to the public_pubsub vhost (iad2) run_once: true - delegate_to: "rabbitmq01{{ env_suffix }}.{{ datacenter }}.fedoraproject.org" + delegate_to: "rabbitmq01{{ env_suffix }}.{{ item }}.fedoraproject.org" + with_items: "{{ datacenter }}" when: "env == 'production' and datacenter == 'iad2'" rabbitmq_parameter: component: "federation-upstream" @@ -407,7 +417,8 @@ - name: Configure a policy to federate the pubsub topic exchange to public_pubsub run_once: true - delegate_to: "rabbitmq01{{ env_suffix }}.{{ datacenter }}.fedoraproject.org" + delegate_to: "rabbitmq01{{ env_suffix }}.{{ item }}.fedoraproject.org" + with_items: "{{ datacenter }}" rabbitmq_policy: apply_to: exchanges name: pubsub-to-public_pubsub