RabbitMQ: leave it to apps to grant access to the nagios-monitoring user

Because those vhosts may not be created yet when the main RabbitMQ
playbook is run.

Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
This commit is contained in:
Aurélien Bompard 2020-02-14 11:22:44 +01:00 committed by Pierre-Yves Chibon
parent f21127ef84
commit 48de31d042
3 changed files with 32 additions and 17 deletions

View file

@ -78,6 +78,21 @@
- config
- bodhi
- name: Grant the nagios-monitoring user access to the bodhi vhost
run_once: true
delegate_to: "rabbitmq01{{ env_suffix }}.phx2.fedoraproject.org"
rabbitmq_user:
user: nagios-monitoring
vhost: /bodhi
configure_priv: "^$"
read_priv: "^$"
write_priv: "^$"
tags: monitoring
tags:
- rabbitmq_cluster
- config
- bodhi
# Create a user for Celery
# - name: Create a user for Celery usage
# run_once: true
@ -106,4 +121,4 @@
tags:
- rabbitmq_cluster
- config
- bodhi
- bodhi

View file

@ -140,6 +140,22 @@
- odcs
- odcs/backend
- name: Grant the nagios-monitoring user access to the odcs vhost
run_once: true
delegate_to: "rabbitmq01{{ env_suffix }}.phx2.fedoraproject.org"
rabbitmq_user:
user: nagios-monitoring
vhost: /odcs
configure_priv: "^$"
read_priv: "^$"
write_priv: "^$"
tags: monitoring
tags:
- rabbitmq_cluster
- config
- odcs
- odcs/backend
# Create a user with:
- name: Create a user for odcs access
run_once: true

View file

@ -225,14 +225,6 @@
configure_priv: "^$"
read_priv: "^$"
write_priv: "^$"
- vhost: /bodhi
configure_priv: "^$"
read_priv: "^$"
write_priv: "^$"
- vhost: /odcs
configure_priv: "^$"
read_priv: "^$"
write_priv: "^$"
tags: monitoring
when: env == "staging" and inventory_hostname.startswith('rabbitmq01')
tags:
@ -257,14 +249,6 @@
configure_priv: "^$"
read_priv: "^$"
write_priv: "^$"
- vhost: /bodhi
configure_priv: "^$"
read_priv: "^$"
write_priv: "^$"
- vhost: /odcs
configure_priv: "^$"
read_priv: "^$"
write_priv: "^$"
tags: monitoring
when: env == "production" and inventory_hostname.startswith('rabbitmq01')
tags: