RabbitMQ: add topic auth to more apps

Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
This commit is contained in:
Aurélien Bompard 2022-07-05 08:35:10 +02:00
parent 632f16f252
commit 4249161ad0
No known key found for this signature in database
GPG key ID: 31584CFEB9BF64AD
34 changed files with 98 additions and 44 deletions

View file

@ -46,6 +46,8 @@ messaging:
- app_name: Copr build system - app_name: Copr build system
key: copr key: copr
username: copr username: copr
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.copr\..*
nrpe_procs_crit: 2500 nrpe_procs_crit: 2500
nrpe_procs_warn: 2200 nrpe_procs_warn: 2200
root_auth_users: msuchy pingou frostyx praiskup root_auth_users: msuchy pingou frostyx praiskup

View file

@ -40,6 +40,8 @@ messaging:
- app_name: Copr build system - app_name: Copr build system
key: copr key: copr
username: copr username: copr
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.copr\..*
root_auth_users: msuchy pingou frostyx praiskup root_auth_users: msuchy pingou frostyx praiskup
spawn_in_advance: "false" spawn_in_advance: "false"
tcp_ports: [ tcp_ports: [

View file

@ -61,6 +61,8 @@ primary_auth_source: ipa
tcp_ports: [80] tcp_ports: [80]
# for fedora-messaging # for fedora-messaging
username: "github2fedmsg{{ env_suffix }}" username: "github2fedmsg{{ env_suffix }}"
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.github\..*
# Definining these vars has a number of effects # Definining these vars has a number of effects
# 1) mod_wsgi is configured to use the vars for its own setup # 1) mod_wsgi is configured to use the vars for its own setup
# 2) iptables opens enough ports for all threads for fedmsg # 2) iptables opens enough ports for all threads for fedmsg

View file

@ -60,6 +60,8 @@ num_cpus: 1
tcp_ports: [80] tcp_ports: [80]
# for fedora-messaging # for fedora-messaging
username: "github2fedmsg{{ env_suffix }}" username: "github2fedmsg{{ env_suffix }}"
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.github\..*
# Definining these vars has a number of effects # Definining these vars has a number of effects
# 1) mod_wsgi is configured to use the vars for its own setup # 1) mod_wsgi is configured to use the vars for its own setup
# 2) iptables opens enough ports for all threads for fedmsg # 2) iptables opens enough ports for all threads for fedmsg

View file

@ -21,6 +21,8 @@ messaging:
- app_name: Copr build system - app_name: Copr build system
key: copr key: copr
username: copr username: copr
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.copr\..*
# There is no python2 on F30 # There is no python2 on F30
nagios_Check_Services: nagios_Check_Services:
dhcpd: false dhcpd: false

View file

@ -21,6 +21,8 @@ messaging:
- app_name: Copr build system - app_name: Copr build system
key: copr key: copr
username: copr username: copr
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.copr\..*
nagios_Check_Services: nagios_Check_Services:
dhcpd: false dhcpd: false
httpd: false httpd: false

View file

@ -29,8 +29,6 @@
- role: httpd/certificate - role: httpd/certificate
certname: "{{wildcard_cert_name}}" certname: "{{wildcard_cert_name}}"
SSLCertificateChainFile: "{{wildcard_int_file}}" SSLCertificateChainFile: "{{wildcard_int_file}}"
- role: rabbit/user
username: "mirror_pagure_ansible{{ env_suffix }}"
- role: rabbit/user - role: rabbit/user
username: "batcave{{ env_suffix }}" username: "batcave{{ env_suffix }}"
sent_topics: sent_topics:
@ -40,18 +38,22 @@
username: "mirror_pagure_ansible{{ env_suffix }}" username: "mirror_pagure_ansible{{ env_suffix }}"
queue_name: "mirror_pagure_ansible{{ env_suffix }}" queue_name: "mirror_pagure_ansible{{ env_suffix }}"
routing_keys: routing_keys:
- "io.pagure.*.pagure.git.receive" - "io.pagure.*.pagure.git.receive"
thresholds: thresholds:
warning: 10 warning: 10
critical: 100 critical: 100
sent_topics:
- ^$
- role: rabbit/queue - role: rabbit/queue
username: "mirror_pagure_ansible{{ env_suffix }}" username: "mirror_pagure_ansible{{ env_suffix }}"
queue_name: "mirror_pagure_ansible{{ env_suffix }}_13" queue_name: "mirror_pagure_ansible{{ env_suffix }}_13"
routing_keys: routing_keys:
- "io.pagure.*.pagure.git.receive" - "io.pagure.*.pagure.git.receive"
thresholds: thresholds:
warning: 10 warning: 10
critical: 100 critical: 100
sent_topics:
- ^$
when: datacenter != 'iad2' when: datacenter != 'iad2'
- batcave - batcave
- role: grobisplitter - role: grobisplitter

View file

@ -118,6 +118,8 @@
- sudo - sudo
- role: rabbit/user - role: rabbit/user
username: "koji{{ env_suffix }}" username: "koji{{ env_suffix }}"
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.buildsys\..*
tasks: tasks:
- import_tasks: "{{ tasks_path }}/motd.yml" - import_tasks: "{{ tasks_path }}/motd.yml"

View file

@ -31,6 +31,8 @@
# Set up for fedora-messaging # Set up for fedora-messaging
- role: rabbit/user - role: rabbit/user
username: "logging{{ env_suffix }}" username: "logging{{ env_suffix }}"
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.logging\.stats\..*
- logging - logging
pre_tasks: pre_tasks:

View file

@ -99,8 +99,10 @@
mailman_hyperkitty_cookie_key: "{{ mailman_hk_cookie_key }}" mailman_hyperkitty_cookie_key: "{{ mailman_hk_cookie_key }}"
- role: fedmsg/base - role: fedmsg/base
# Set up for fedora-messaging # Set up for fedora-messaging
- { role: rabbit/user, - role: rabbit/user
username: "mailman{{ env_suffix }}"} username: "mailman{{ env_suffix }}"
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.mailman\..*
tasks: tasks:
- name: install more needed packages - name: install more needed packages

View file

@ -102,8 +102,11 @@
roles: roles:
- role: fedmsg/base - role: fedmsg/base
# Set up for fedora-messaging # Set up for fedora-messaging
- { role: rabbit/user, - role: rabbit/user
username: "mirrormanager{{ env_suffix }}"} username: "mirrormanager{{ env_suffix }}"
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.mirrormanager\..*
- ^org\.fedoraproject\.{{ env_short }}\.logger\.log\..*
handlers: handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml" - import_tasks: "{{ handlers_path }}/restart_services.yml"

View file

@ -36,8 +36,11 @@
- collectd/base - collectd/base
- fedmsg/base - fedmsg/base
# Set up for fedora-messaging # Set up for fedora-messaging
- { role: rabbit/user, - role: rabbit/user
username: "notifs-backend{{ env_suffix }}"} username: "notifs-backend{{ env_suffix }}"
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.fmn\..*
- ^org\.fedoraproject\.{{ env_short }}\.logger\.log\..*
- sudo - sudo
tasks: tasks:

View file

@ -27,8 +27,11 @@
- mod_wsgi - mod_wsgi
- role: fedmsg/base - role: fedmsg/base
# Set up for fedora-messaging # Set up for fedora-messaging
- { role: rabbit/user, - role: rabbit/user
username: "notifs-web{{ env_suffix }}"} username: "notifs-web{{ env_suffix }}"
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.fmn\..*
- ^org\.fedoraproject\.{{ env_short }}\.logger\.log\..*
- notifs/frontend - notifs/frontend
- sudo - sudo

View file

@ -44,6 +44,8 @@
roles: roles:
- role: rabbit/user - role: rabbit/user
username: "odcs{{ env_suffix }}" username: "odcs{{ env_suffix }}"
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.odcs\..*
- mod_wsgi - mod_wsgi
- role: nfs/client - role: nfs/client
mnt_dir: '/mnt/fedora_koji' mnt_dir: '/mnt/fedora_koji'
@ -144,8 +146,6 @@
roles: roles:
- role: keytab/service - role: keytab/service
service: odcs service: odcs
- role: rabbit/user
username: "fmc{{ env_suffix }}"
- role: rabbit/queue - role: rabbit/queue
username: "fmc{{ env_suffix }}" username: "fmc{{ env_suffix }}"
queue_name: "{{ fmc_queue_name }}" queue_name: "{{ fmc_queue_name }}"
@ -153,6 +153,8 @@
thresholds: thresholds:
warning: 100 warning: 100
critical: 1000 critical: 1000
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.odcs\..*
- role: fmc - role: fmc
handlers: handlers:

View file

@ -47,5 +47,8 @@
# Set up for fedora-messaging # Set up for fedora-messaging
- role: rabbit/user - role: rabbit/user
username: "pdc{{ env_suffix }}" username: "pdc{{ env_suffix }}"
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.pdc\..*
- ^org\.fedoraproject\.{{ env_short }}\.logger\.log\..*
when: inventory_hostname.startswith(('pdc-web01','pdc-web01.stg')) when: inventory_hostname.startswith(('pdc-web01','pdc-web01.stg'))
- pdc/frontend - pdc/frontend

View file

@ -77,6 +77,7 @@
username: "planet{{ env_suffix }}" username: "planet{{ env_suffix }}"
sent_topics: sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.planet\..* - ^org\.fedoraproject\.{{ env_short }}\.planet\..*
- ^org\.fedoraproject\.{{ env_short }}\.logger\.log\..*
- role: apache - role: apache

View file

@ -84,6 +84,8 @@
username: "pagure{{ env_suffix }}" username: "pagure{{ env_suffix }}"
sent_topics: sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.pagure\..* - ^org\.fedoraproject\.{{ env_short }}\.pagure\..*
- ^org\.fedoraproject\.{{ env_short }}\.git\..*
- ^org\.fedoraproject\.{{ env_short }}\.logger\.log\..*
handlers: handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml" - import_tasks: "{{ handlers_path }}/restart_services.yml"

View file

@ -130,6 +130,10 @@
- role: rabbit/user - role: rabbit/user
username: "pungi{{ env_suffix }}" username: "pungi{{ env_suffix }}"
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.logger\.log\..*
- ^org\.fedoraproject\.{{ env_short }}\.pungi\..*
- ^org\.fedoraproject\.{{ env_short }}\.compose\..*
- { - {
role: "push-container-registry", role: "push-container-registry",

View file

@ -27,7 +27,7 @@
roles: roles:
- role: rabbit/queue - role: rabbit/queue
username: faf username: faf{{ env_suffix }}
queue_name: faf queue_name: faf
routing_keys: routing_keys:
- "org.fedoraproject.*.faf.report.threshold1" - "org.fedoraproject.*.faf.report.threshold1"
@ -46,6 +46,8 @@
- "org.fedoraproject.*.faf.problem.threshold10000" - "org.fedoraproject.*.faf.problem.threshold10000"
- "org.fedoraproject.*.faf.problem.threshold100000" - "org.fedoraproject.*.faf.problem.threshold100000"
- "org.fedoraproject.*.faf.problem.threshold1000000" - "org.fedoraproject.*.faf.problem.threshold1000000"
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.faf\..*
- name: Setup retrace hosts - name: Setup retrace hosts
hosts: retrace,retrace_stg hosts: retrace,retrace_stg

View file

@ -55,9 +55,11 @@
when: master_sundries_node|bool when: master_sundries_node|bool
- role: fedora-web/kinoite/build - role: fedora-web/kinoite/build
when: master_sundries_node|bool when: master_sundries_node|bool
- { role: rabbit/user, - role: rabbit/user
username: "sundries{{ env_suffix }}", username: "sundries{{ env_suffix }}"
when: master_sundries_node|bool and deployment_type == "stg" } sent_topics:
- ^$
when: master_sundries_node|bool and deployment_type == "stg"
- role: fedmsg/base - role: fedmsg/base
when: master_sundries_node|bool when: master_sundries_node|bool
- role: nfs/client - role: nfs/client

View file

@ -30,8 +30,13 @@
- apache - apache
- fedmsg/base - fedmsg/base
# Set up for fedora-messaging # Set up for fedora-messaging
- { role: rabbit/user, username: "wiki{{ env_suffix }}", when: inventory_hostname.startswith('wiki01') } - role: rabbit/queue
- { role: rabbit/queue, username: "wiki{{ env_suffix }}", queue_name: "wiki{{ env_suffix }}"} username: "wiki{{ env_suffix }}"
queue_name: "wiki{{ env_suffix }}"
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.wiki\..*
- ^org\.fedoraproject\.{{ env_short }}\.logger\.log\..*
when: inventory_hostname.startswith('wiki01')
- { role: nfs/client, when: env == "staging", mnt_dir: '/mnt/web/attachments', nfs_src_dir: 'fedora_app_staging/app/attachments' } - { role: nfs/client, when: env == "staging", mnt_dir: '/mnt/web/attachments', nfs_src_dir: 'fedora_app_staging/app/attachments' }
- { role: nfs/client, when: env != "staging", mnt_dir: '/mnt/web/attachments', nfs_src_dir: 'fedora_app/app/attachments' } - { role: nfs/client, when: env != "staging", mnt_dir: '/mnt/web/attachments', nfs_src_dir: 'fedora_app/app/attachments' }
- mediawiki - mediawiki

View file

@ -67,6 +67,9 @@
- "org.fedoraproject.*.coreos.build.request.artifacts-sign" - "org.fedoraproject.*.coreos.build.request.artifacts-sign"
- "org.fedoraproject.*.coreos.build.request.ostree-sign" - "org.fedoraproject.*.coreos.build.request.ostree-sign"
- "org.fedoraproject.*.buildsys.tag" - "org.fedoraproject.*.buildsys.tag"
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.coreos\..*\.finished$
- ^org\.fedoraproject\.{{ env_short }}\.robosignatory\..*\.finished$
- robosignatory - robosignatory
- role: keytab/service - role: keytab/service
service: autosign service: autosign

View file

@ -43,6 +43,8 @@
thresholds: thresholds:
warning: 10 warning: 10
critical: 100 critical: 100
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.coreos\..*
# Fedora Messaging secrets # Fedora Messaging secrets
- role: openshift/secret-file - role: openshift/secret-file

View file

@ -19,6 +19,8 @@
thresholds: thresholds:
warning: 50 warning: 50
critical: 100 critical: 100
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.greenwave\..*
# The openshift/project role breaks if the project already exists: # The openshift/project role breaks if the project already exists:
# https://pagure.io/fedora-infrastructure/issue/6404 # https://pagure.io/fedora-infrastructure/issue/6404

View file

@ -16,6 +16,9 @@
queue_name: "{{ app }}{{ env_suffix }}" queue_name: "{{ app }}{{ env_suffix }}"
routing_keys: [] routing_keys: []
message_ttl: 60000 message_ttl: 60000
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.koschei\..*
- ^org\.fedoraproject\.{{ env_short }}\.ci\..*
- openshift/project - openshift/project

View file

@ -37,9 +37,6 @@
# Setup for fedora-messaging # Setup for fedora-messaging
- role: rabbit/user
username: "mts{{ env_suffix }}"
- role: rabbit/queue - role: rabbit/queue
username: "mts{{ env_suffix }}" username: "mts{{ env_suffix }}"
queue_name: "mts{{ env_suffix }}" queue_name: "mts{{ env_suffix }}"
@ -48,6 +45,8 @@
thresholds: thresholds:
warning: 10 warning: 10
critical: 100 critical: 100
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.build\.tag\..*
# cacert, certificate and private key for fedora-messaging # cacert, certificate and private key for fedora-messaging

View file

@ -26,6 +26,8 @@
- role: rabbit/user - role: rabbit/user
username: "monitor-gating{{ env_suffix }}" username: "monitor-gating{{ env_suffix }}"
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.monitor-gating\..*
- role: openshift/keytab - role: openshift/keytab
app: monitor-gating app: monitor-gating

View file

@ -9,9 +9,6 @@
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
roles: roles:
- role: rabbit/user
username: "resultsdb{{ env_suffix }}_ci_listener"
- role: rabbit/queue - role: rabbit/queue
username: "resultsdb{{ env_suffix }}_ci_listener" username: "resultsdb{{ env_suffix }}_ci_listener"
queue_name: "resultsdb{{ env_suffix }}_ci_listener" queue_name: "resultsdb{{ env_suffix }}_ci_listener"
@ -25,6 +22,8 @@
- 'org.centos.*.ci.koji-build.test.running' - 'org.centos.*.ci.koji-build.test.running'
- 'org.centos.*.ci.koji-build.test.complete' - 'org.centos.*.ci.koji-build.test.complete'
- 'org.centos.*.ci.koji-build.test.error' - 'org.centos.*.ci.koji-build.test.error'
sent_topics:
- ^$
# The openshift/project role breaks if the project already exists: # The openshift/project role breaks if the project already exists:
# https://pagure.io/fedora-infrastructure/issue/6404 # https://pagure.io/fedora-infrastructure/issue/6404

View file

@ -40,6 +40,8 @@
roles: roles:
- role: rabbit/user - role: rabbit/user
username: "resultsdb{{ env_suffix }}" username: "resultsdb{{ env_suffix }}"
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.resultsdb\..*
# The openshift/project role breaks if the project already exists: # The openshift/project role breaks if the project already exists:
# https://pagure.io/fedora-infrastructure/issue/6404 # https://pagure.io/fedora-infrastructure/issue/6404

View file

@ -22,9 +22,6 @@
tags: tags:
- appowners - appowners
- role: rabbit/user
username: "toddlers{{ env_suffix }}"
- role: rabbit/queue - role: rabbit/queue
username: toddlers{{ env_suffix }} username: toddlers{{ env_suffix }}
queue_name: toddlers{{ env_suffix }} queue_name: toddlers{{ env_suffix }}
@ -56,6 +53,8 @@
thresholds: thresholds:
warning: 10 warning: 10
critical: 100 critical: 100
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.toddlers\..*
- role: openshift/keytab - role: openshift/keytab
app: toddlers app: toddlers

View file

@ -39,6 +39,8 @@
roles: roles:
- role: rabbit/user - role: rabbit/user
username: "waiverdb{{ env_suffix }}" username: "waiverdb{{ env_suffix }}"
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.waiverdb\..*
# The openshift/project role breaks if the project already exists: # The openshift/project role breaks if the project already exists:
# https://pagure.io/fedora-infrastructure/issue/6404 # https://pagure.io/fedora-infrastructure/issue/6404

View file

@ -56,6 +56,7 @@
include_role: name=rabbit/user include_role: name=rabbit/user
vars: vars:
- username: "{{ item.username }}{{ env_suffix }}" - username: "{{ item.username }}{{ env_suffix }}"
sent_topics: "{{ item.sent_topics }}"
with_items: "{{ messaging.certificates }}" with_items: "{{ messaging.certificates }}"
tags: tags:
- fedora-messaging - fedora-messaging

View file

@ -68,14 +68,9 @@
include_role: include_role:
name: rabbit/user name: rabbit/user
vars: vars:
username: copr{{ env_suffix }} username: copr{{ env_suffix }}
sent_topics:
- name: faf - ^org\.fedoraproject\.{{ env_short }}\.copr\..*
run_once: true
include_role:
name: rabbit/user
vars:
username: faf{{ env_suffix }}
- name: CentOS Stream - name: CentOS Stream
run_once: true run_once: true
@ -371,13 +366,6 @@
# #
# ELN BEGIN # ELN BEGIN
- name: eln build user
run_once: true
include_role:
name: rabbit/user
vars:
username: distrobuildsync-eln
- name: eln queue - name: eln queue
run_once: true run_once: true
include_role: include_role:

View file

@ -104,6 +104,8 @@
name: rabbit/user name: rabbit/user
vars: vars:
username: "{{ botnames[env] }}" username: "{{ botnames[env] }}"
sent_topics:
- ^org\.fedoraproject\.{{ env_short }}\.meetbot\..*
when: when:
- inventory_hostname.startswith('value02') - inventory_hostname.startswith('value02')