From 9370ffcf7e8b08ba5eee415b6b2cf471d5c1554c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Fri, 14 Feb 2020 13:49:29 +0100 Subject: [PATCH] Add the rabbitmq_cluster tag to the rabbit roles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aurélien Bompard --- roles/rabbit/queue/tasks/main.yml | 32 +++++++++++++++++++++++-------- roles/rabbit/user/tasks/main.yml | 5 ++++- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/roles/rabbit/queue/tasks/main.yml b/roles/rabbit/queue/tasks/main.yml index 68ced30157..7e7991f394 100644 --- a/roles/rabbit/queue/tasks/main.yml +++ b/roles/rabbit/queue/tasks/main.yml @@ -26,7 +26,9 @@ that: - "queue_name.startswith(username)" fail_msg: "Your queue name must be prefixed with your username" - tags: fedora-messaging + tags: + - fedora-messaging + - rabbitmq_cluster - name: Validate the user parameter assert: @@ -35,7 +37,9 @@ - username != "guest" - username != "nagios-monitoring" fail_msg: "This user name is reserved" - tags: fedora-messaging + tags: + - fedora-messaging + - rabbitmq_cluster # See https://www.rabbitmq.com/access-control.html#permissions for details on # the RabbitMQ permissions configuration. @@ -51,7 +55,9 @@ write_priv: "^(amq\\.topic)|({{ username }}.*){% for queue in write_queues|default([]) %}|({{ queue }}.*){% endfor %}$" configure_priv: "^$" # No configuration permissions state: present - tags: fedora-messaging + tags: + - fedora-messaging + - rabbitmq_cluster - name: Create the {{ queue_name }} queue in RabbitMQ delegate_to: "{{ rabbitmq_server }}" @@ -64,7 +70,9 @@ state: present login_user: admin login_password: "{{ (env == 'production')|ternary(rabbitmq_admin_password_production, rabbitmq_admin_password_staging) }}" - tags: fedora-messaging + tags: + - fedora-messaging + - rabbitmq_cluster - name: Bind the {{ queue_name }} queue to the amq.topic exchange delegate_to: "{{ rabbitmq_server }}" @@ -78,7 +86,9 @@ login_user: admin login_password: "{{ (env == 'production')|ternary(rabbitmq_admin_password_production, rabbitmq_admin_password_staging) }}" loop: "{{ routing_keys }}" - tags: fedora-messaging + tags: + - fedora-messaging + - rabbitmq_cluster # This can be removed when we're done with fedmsg and the bridges are retired. - name: Bind the {{ queue_name }} queue to the zmq.topic exchange @@ -93,7 +103,9 @@ login_user: admin login_password: "{{ (env == 'production')|ternary(rabbitmq_admin_password_production, rabbitmq_admin_password_staging) }}" loop: "{{ routing_keys }}" - tags: fedora-messaging + tags: + - fedora-messaging + - rabbitmq_cluster - name: Monitor the {{ queue_name }} queue in Nagios (NRPE) when: thresholds and env == "production" @@ -105,7 +117,9 @@ group: root mode: 0644 notify: restart nrpe on rabbitmq - tags: fedora-messaging + tags: + - fedora-messaging + - rabbitmq_cluster - name: Monitor the {{ queue_name }} queue in Nagios when: thresholds and env == "production" @@ -114,4 +128,6 @@ src: nagios.cfg.j2 dest: /etc/nagios/services/rabbitmq-queue-{{ queue_name }}.cfg notify: restart nagios on noc - tags: fedora-messaging + tags: + - fedora-messaging + - rabbitmq_cluster diff --git a/roles/rabbit/user/tasks/main.yml b/roles/rabbit/user/tasks/main.yml index 6d0b67a91c..adcca71cb1 100644 --- a/roles/rabbit/user/tasks/main.yml +++ b/roles/rabbit/user/tasks/main.yml @@ -19,7 +19,9 @@ - username != "guest" - username != "nagios-monitoring" fail_msg: "This user name is reserved" - tags: fedora-messaging + tags: + - fedora-messaging + - rabbitmq_cluster - name: Create the user in RabbitMQ delegate_to: "{{ rabbitmq_server }}" @@ -33,3 +35,4 @@ tags: - config - fedora-messaging + - rabbitmq_cluster