diff --git a/inventory/group_vars/relvalconsumer_common b/inventory/group_vars/relvalconsumer_common index dcc626e83a..30e49a5c7b 100644 --- a/inventory/group_vars/relvalconsumer_common +++ b/inventory/group_vars/relvalconsumer_common @@ -11,6 +11,8 @@ relvalconsumer_amqp_key: /etc/pki/fedora-messaging/openqa-key.pem relvalconsumer_amqp_cert: /etc/pki/fedora-messaging/openqa-cert.pem relvalconsumer_amqp_queue: "openqa_relvalconsumer{{ relvalconsumer_env_suffix }}" relvalconsumer_amqp_routing_keys: ["org.fedoraproject.prod.pungi.compose.status.change"] +relvalamiconsumer_amqp_queue: "openqa_relvalamiconsumer{{ relvalconsumer_env_suffix }}" +relvalamiconsumer_amqp_routing_keys: ["org.fedoraproject.prod.fedimg.image.publish"] # fedora-messaging email error reporting settings relvalconsumer_amqp_mailto: ["adamwill@fedoraproject.org", "lruzicka@fedoraproject.org"] diff --git a/playbooks/groups/openqa.yml b/playbooks/groups/openqa.yml index 0a51eaf875..a26594ee29 100644 --- a/playbooks/groups/openqa.yml +++ b/playbooks/groups/openqa.yml @@ -103,6 +103,23 @@ env: "production" env_suffix: "" tags: ['rabbit'] + # relvalamiconsumer queue, we still use openqa auth for this as it's + # easy that way + - role: rabbit/queue + username: "openqa" + queue_name: "openqa_relvalamiconsumer{{ relvalconsumer_env_suffix }}" + routing_keys: + - "org.fedoraproject.prod.fedimg.image.publish" + write_queues: + - "ci" + - "openqa" + vars: + # yes, even the staging updater listens to production, it + # has to as we never publish fedimg.image.publish on stg + env: "production" + env_suffix: "" + tags: ['rabbit'] + # autocloudreporter queue, we still use openqa auth for this as it's # easy that way - role: rabbit/queue diff --git a/roles/relvalconsumer/defaults/main.yml b/roles/relvalconsumer/defaults/main.yml index c3e7b83e19..de0d5d59b9 100644 --- a/roles/relvalconsumer/defaults/main.yml +++ b/roles/relvalconsumer/defaults/main.yml @@ -7,3 +7,4 @@ relvalconsumer_amqp_cert: /etc/fedora-messaging/fedora-cert.pem relvalconsumer_amqp_routing_keys: ["org.fedoraproject.prod.pungi.compose.status.change"] relvalconsumer_amqp_mailfrom: "root@{{ external_hostname }}" relvalconsumer_amqp_smtp: localhost +relvalamiconsumer_amqp_routing_keys: ["org.fedoraproject.prod.fedimg.image.publish"] diff --git a/roles/relvalconsumer/handlers/main.yml b/roles/relvalconsumer/handlers/main.yml index 163023f21d..e1874d114e 100644 --- a/roles/relvalconsumer/handlers/main.yml +++ b/roles/relvalconsumer/handlers/main.yml @@ -1,5 +1,10 @@ -# Restart handler for our fedora-messaging consumer +# Restart handler for our fedora-messaging consumers - name: Conditionally restart relvalconsumer consumer service command: /usr/local/bin/conditional-restart.sh fm-consumer@relvalconsumer - listen: + listen: - restart relvalconsumer + +- name: Conditionally restart relvalamiconsumer consumer service + command: /usr/local/bin/conditional-restart.sh fm-consumer@relvalamiconsumer + listen: + - restart relvalamiconsumer diff --git a/roles/relvalconsumer/tasks/main.yml b/roles/relvalconsumer/tasks/main.yml index a8e924eb5e..62b168744f 100644 --- a/roles/relvalconsumer/tasks/main.yml +++ b/roles/relvalconsumer/tasks/main.yml @@ -1,6 +1,8 @@ # This role creates Wikitcms release validation events. There should # always be exactly one host in infra with this role set up and # relvalconsumer_prod set to True, or else we'll stop getting events. +# It also updates the AMI pages for the events when relevant AMI +# images are published. # # Required vars # - wikitcms_token @@ -14,6 +16,14 @@ ## This should be a unique and private string; the ## official recommendation is to use a random UUID ## generated by uuidgen. +# - relvalamiconsumer_amqp_queue +## string - Message queue name for the AMI consumer. To use the +## fedora-messaging scheduler with public authentication +## on the Fedora production AMQP broker (which is what +## you'd typically want), you only need to set this. +## This should be a unique and private string; the +## official recommendation is to use a random UUID +## generated by uuidgen. # # Required vars with defaults # - relvalconsumer_prod @@ -27,28 +37,28 @@ ## brokers. ## default - False # - relvalconsumer_amqp_url -## string - AMQP broker URL for fedora-messaging job scheduler. +## string - AMQP broker URL for fedora-messaging event creator. ## The role default for this is the Fedora production ## broker with the shared 'fedora' username. # - relvalconsumer_amqp_cacert ## string - CA certificate file to use for authenticating with -## AMQP broker for fedora-messaging job scheduler. +## AMQP broker for fedora-messaging event creator. ## The role default for this is the CA cert file for the ## Fedora production broker. # - relvalconsumer_amqp_cert ## string - Certificate file to use for authenticating with AMQP -## broker for fedora-messaging job scheduler. The role +## broker for fedora-messaging event creator. The role ## default for this is the certificate file for the ## public 'fedora' account on the Fedora production ## broker. # - relvalconsumer_amqp_key ## string - Private key file to use for authenticating with AMQP -## broker for fedora-messaging job scheduler. The role +## broker for fedora-messaging event creator. The role ## default for this is the key file for the public ## 'fedora' account on the Fedora production broker. # - relvalconsumer_amqp_routing_keys ## list - List of routing key names for the fedora-messaging -## scheduler to subscribe to. The role default for this +## creator to subscribe to. The role default for this ## is the appropriate keys for the Fedora production ## broker. # - relvalconsumer_amqp_mailfrom @@ -59,6 +69,11 @@ ## string - Hostname of SMTP server to use for sending error ## emails. Defaults to 'localhost'. Only relevant if ## relvalconsumer_amqp_mailto is set. +# - relvalamiconsumer_amqp_routing_keys +## list - List of routing key names for the event AMI page +## updater to subscribe to. The role default for this +## is the appropriate keys for the Fedora production +## broker. # # Optional vars # - relvalconsumer_amqp_mailto @@ -190,6 +205,13 @@ tags: - config +- name: Configure fedora-messaging relvalamiconsumer + template: src=relvalamiconsumer.toml.j2 dest=/etc/fedora-messaging/relvalamiconsumer.toml owner=root group=root mode=0640 + notify: + - restart relvalamiconsumer + tags: + - config + - name: Wipe the old fedmsg consumer config file file: path=/etc/fedmsg.d/relvalconsumer.py state=absent notify: @@ -199,3 +221,6 @@ - name: Enable and start fedora-messaging relvalconsumer service: name=fm-consumer@relvalconsumer enabled=yes state=started + +- name: Enable and start fedora-messaging relvalamiconsumer + service: name=fm-consumer@relvalamiconsumer enabled=yes state=started