ELNBuildSync: support staging RabbitMQ
Some checks failed
Linter / yamllint (pull_request) Successful in 28s
Linter / ansible-lint (pull_request) Failing after 59s
AI Code Review / ai-review (pull_request_target) Successful in 46s

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>

rh-pre-commit.version: 2.4.0
rh-pre-commit.check-secrets: ENABLED
This commit is contained in:
Stephen Gallagher 2026-06-09 12:52:36 -04:00
commit 076f51b02c
Signed by untrusted user: sgallagh
GPG key ID: 45DB85A568286D11
4 changed files with 126 additions and 123 deletions

View file

@ -31,25 +31,32 @@
- /srv/private/ansible/vars.yml
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
pre_tasks:
- name: Set up ELN RabbitMQ queue
ansible.builtin.include_role:
name: rabbit/queue
vars:
queue_username: distrobuildsync-eln
user_sent_topics: ^$
queue_name: distrobuildsync-eln
# TTL: 10 days (in miliseconds)
queue_message_ttl: 864000000
queue_routing_keys:
- "#.buildsys.repo.init"
- "#.buildsys.repo.done"
- "#.buildsys.tag"
- "#.buildsys.task.state.change"
- "org.fedoraproject.{{ env_short }}.elnbuildsync.#"
when: env != 'staging'
roles:
- role: rabbit/user
user_name: "elnbuildsync{{ env_suffix }}"
user_sent_topics: ^$
tags:
- config
- fedora-messaging
- rabbitmq_cluster
- role: rabbit/queue
queue_username: "elnbuildsync{{ env_suffix }}"
user_sent_topics: ^$
queue_name: "elnbuildsync{{ env_suffix }}"
# TTL: 10 days (in miliseconds)
queue_message_ttl: 864000000
queue_routing_keys:
- "#.buildsys.repo.init"
- "#.buildsys.repo.done"
- "#.buildsys.tag"
- "#.buildsys.task.state.change"
- "org.fedoraproject.{{ env_short }}.elnbuildsync.#"
tags:
- config
- fedora-messaging
- rabbitmq_cluster
- role: openshift/project
project_app: elnbuildsync
project_description: ELNBuildSync is a tool that listens for Fedora Rawhide builds and re-builds them in the Fedora ELN build environment.

View file

@ -0,0 +1,97 @@
# A basic configuration for Fedora's message broker, using the example callback
# which simply prints messages to standard output.
#
# This file is in the TOML format.
amqp_url = "amqps://elnbuildsync:@rabbitmq{{ env_suffix}}.fedoraproject.org/%2Fpubsub"
callback = "fedora_messaging.example:printer"
passive_declares = true
[tls]
ca_cert = "/etc/fedora-messaging/cacert.pem"
keyfile = "/etc/fedora-messaging/elnbuildsync.key"
certfile = "/etc/fedora-messaging/elnbuildsync.crt"
[client_properties]
app = "ELNBuildSync"
# Some suggested extra fields:
# URL of the project that provides this consumer
app_url = "https://github.com/fedora-eln/elnbuildsync"
# Contact emails for the maintainer(s) of the consumer - in case the
# broker admin needs to contact them, for e.g.
app_contacts_email = ["sgallagh@fedoraproject.org", "yselkowitz@fedoraproject.org"]
[exchanges."amq.topic"]
type = "topic"
durable = true
auto_delete = false
arguments = {}
# Queue names *must* be in the normal UUID format: run "uuidgen" and use the
# output as your queue name. If your queue is not exclusive, anyone can connect
# and consume from it, causing you to miss messages, so do not share your queue
# name. Any queues that are not auto-deleted on disconnect are garbage-collected
# after approximately one hour.
#
# If you require a stronger guarantee about delivery, please talk to Fedora's
# Infrastructure team.
[queues.elnbuildsync{{ env_suffix }}]
durable = true
auto_delete = false
exclusive = true
arguments = {}
[[bindings]]
queue = "elnbuildsync{{ env_suffix }}"
exchange = "amq.topic"
routing_keys = [
"org.fedoraproject.prod.buildsys.repo.init",
"org.fedoraproject.prod.buildsys.repo.done",
"org.fedoraproject.prod.buildsys.tag",
"org.fedoraproject.prod.buildsys.task.state.change"
]
[consumer_config]
example_key = "for my consumer"
[qos]
prefetch_size = 0
prefetch_count = 25
[log_config]
version = 1
disable_existing_loggers = true
[log_config.formatters.simple]
format = "[%(module)s %(levelname)s %(name)s] %(message)s"
[log_config.handlers.console]
class = "logging.StreamHandler"
formatter = "simple"
stream = "ext://sys.stdout"
[log_config.loggers.fedora_messaging]
level = "CRITICAL"
propagate = false
handlers = []
[log_config.loggers.twisted]
level = "CRITICAL"
propagate = false
handlers = ["console"]
[log_config.loggers.pika]
level = "CRITICAL"
propagate = false
handlers = ["console"]
# If your consumer sets up a logger, you must add a configuration for it
# here in order for the messages to show up. e.g. if it set up a logger
# called 'example_printer', you could do:
#[log_config.loggers.example_printer]
#level = "INFO"
#propagate = false
#handlers = ["console"]
[log_config.root]
level = "ERROR"
handlers = ["console"]

View file

@ -4,10 +4,10 @@ metadata:
name: fedora-messaging-config
stringData:
config.toml: |-
{{ ebs_fedora_messaging_config | indent(4) }}
{{ load_file('fedora-messaging-config.toml') | indent(4) }}
cacert.pem: |-
{{ ebs_fedora_messaging_cacert | indent(4) }}
{{ (env == 'staging') | ternary(ebs_fedora_messaging_stg_cacert, ebs_fedora_messaging_cacert) | indent(4) }}
elnbuildsync.crt: |-
{{ ebs_fedora_messaging_client_pem | indent(4) }}
{{ (env == 'staging') | ternary(ebs_fedora_messaging_client_stg_pem, ebs_fedora_messaging_client_pem) | indent(4) }}
elnbuildsync.key: |-
{{ ebs_fedora_messaging_client_key | indent(4) }}
{{ (env == 'staging') | ternary(ebs_fedora_messaging_client_stg_key, ebs_fedora_messaging_client_key) | indent(4) }}

View file

@ -4,104 +4,3 @@ ebs_upstream_ref: 1.1.0
ebs_db_user: elnbuildsync
ebs_db_name: elnbuildsync
ebs_queue_username: distrobuildsync-eln
ebs_fedora_messaging_config: |
# A basic configuration for Fedora's message broker, using the example callback
# which simply prints messages to standard output.
#
# This file is in the TOML format.
amqp_url = "amqps://fedora:@rabbitmq.fedoraproject.org/%2Fpubsub"
callback = "fedora_messaging.example:printer"
passive_declares = true
[tls]
ca_cert = "/etc/fedora-messaging/cacert.pem"
keyfile = "/etc/fedora-messaging/distrobuildsync-eln.key"
certfile = "/etc/fedora-messaging/distrobuildsync-eln.crt"
[client_properties]
app = "Example Application"
# Some suggested extra fields:
# URL of the project that provides this consumer
app_url = "https://github.com/fedora-infra/fedora-messaging"
# Contact emails for the maintainer(s) of the consumer - in case the
# broker admin needs to contact them, for e.g.
app_contacts_email = ["jcline@fedoraproject.org"]
[exchanges."amq.topic"]
type = "topic"
durable = true
auto_delete = false
arguments = {}
# Queue names *must* be in the normal UUID format: run "uuidgen" and use the
# output as your queue name. If your queue is not exclusive, anyone can connect
# and consume from it, causing you to miss messages, so do not share your queue
# name. Any queues that are not auto-deleted on disconnect are garbage-collected
# after approximately one hour.
#
# If you require a stronger guarantee about delivery, please talk to Fedora's
# Infrastructure team.
[queues.distrobuildsync-eln]
durable = true
auto_delete = false
exclusive = true
arguments = {}
[[bindings]]
queue = "distrobuildsync-eln"
exchange = "amq.topic"
routing_keys = [
"org.fedoraproject.prod.buildsys.repo.init",
"org.fedoraproject.prod.buildsys.repo.done",
"org.fedoraproject.prod.buildsys.tag",
"org.fedoraproject.prod.buildsys.task.state.change"
]
[consumer_config]
example_key = "for my consumer"
[qos]
prefetch_size = 0
prefetch_count = 25
[log_config]
version = 1
disable_existing_loggers = true
[log_config.formatters.simple]
format = "[%(module)s %(levelname)s %(name)s] %(message)s"
[log_config.handlers.console]
class = "logging.StreamHandler"
formatter = "simple"
stream = "ext://sys.stdout"
[log_config.loggers.fedora_messaging]
level = "CRITICAL"
propagate = false
handlers = []
[log_config.loggers.twisted]
level = "CRITICAL"
propagate = false
handlers = ["console"]
[log_config.loggers.pika]
level = "CRITICAL"
propagate = false
handlers = ["console"]
# If your consumer sets up a logger, you must add a configuration for it
# here in order for the messages to show up. e.g. if it set up a logger
# called 'example_printer', you could do:
#[log_config.loggers.example_printer]
#level = "INFO"
#propagate = false
#handlers = ["console"]
[log_config.root]
level = "ERROR"
handlers = ["console"]