rabbitmq/server: try this to delegate to each datacenter correctly

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
This commit is contained in:
Kevin Fenzi 2020-05-19 07:56:12 -07:00
parent 3c5c8b5f2a
commit c8d2d330e2

View file

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