|
|
f728bc |
# Fedora Messaging
|
|
|
f728bc |
|
|
|
f728bc |
## Requesting Access
|
|
|
f728bc |
|
|
|
f728bc |
What needs to be done:
|
|
|
f728bc |
|
|
|
f728bc |
* Request certificates from the fedora infrastructure team;
|
|
|
f728bc |
* Ansible changes to create a new user, queue and topic in fedora messaging.
|
|
|
f728bc |
|
|
|
f728bc |
You can request a new certificate and a private key by opening a fedora infrastructure ticket: https://pagure.io/fedora-infrastructure (Example: https://pagure.io/fedora-infrastructure/issue/9494).
|
|
|
f728bc |
|
|
|
f728bc |
The ticket should request a new username for fedora messaging (either prod or stg) - the result of that ticket will be a new certificate and private key for that user (the certificate CN field should contain the requested username as its value).
|
|
|
f728bc |
|
|
|
f728bc |
The next step is to add the new user, queue and topic binding into fedora's Rabbit MQ instance.
|
|
|
f728bc |
|
|
|
f728bc |
This can be done by sending a pull request to their ansible repository (https://pagure.io/fedora-infra/ansible): https://pagure.io/fedora-infra/ansible/pull-request/302#request_diff.
|
|
|
f728bc |
|
|
|
f728bc |
The topic format uses the following scheme: `org.<SOURCE>.<ENV>.<APP>.#` where:
|
|
|
f728bc |
|
|
|
f728bc |
* `<SOURCE>`: source as entity, should be `centos` in our case
|
|
|
73a20a |
* `<ENV>`: env is either `prod` or `stg` but you should use the ansible var `short_env`
|
|
|
f728bc |
* `<APP>`: the application the message belongs to, which matches your username.
|
|
|
f728bc |
|
|
|
f728bc |
A topic for centos koji would be: `org.centos.prod.koji.#` (`#` means Rabbit MQ will match the topic as long as it starts with `org.centos.prod.koji.`).
|
|
|
f728bc |
|
|
|
f728bc |
Those changes will also need to be run by someone from the fedora infrastructure team.
|
|
|
73a20a |
|
|
|
73a20a |
### Example
|
|
|
73a20a |
|
|
|
73a20a |
The following ansible code is an example of how to add an user and a queue with a routing key.
|
|
|
73a20a |
|
|
|
73a20a |
```yaml
|
|
|
73a20a |
# adding "centos-koji" user as an example
|
|
|
73a20a |
|
|
|
73a20a |
- name: Add centos-koji User
|
|
|
73a20a |
run_once: true
|
|
|
73a20a |
include_role:
|
|
|
73a20a |
name: rabbit/user
|
|
|
73a20a |
vars:
|
|
|
73a20a |
username: centos-koji{{ env_suffix }}
|
|
|
73a20a |
|
|
|
73a20a |
- name: Add centos-koji queue
|
|
|
73a20a |
run_once: true
|
|
|
73a20a |
include_role:
|
|
|
73a20a |
name: rabbit/queue
|
|
|
73a20a |
vars:
|
|
|
73a20a |
username: centos-koji{{ env_suffix }}
|
|
|
73a20a |
queue_name: centos-koji{{ env_suffix }}
|
|
|
73a20a |
# TTL: 10 days (in miliseconds)
|
|
|
73a20a |
message_ttl: 864000000
|
|
|
73a20a |
routing_keys:
|
|
|
73a20a |
- "org.centos.{{ env_short }}.koji.#"
|
|
|
73a20a |
```
|