From 45b6adb9e1bf5ac78215cc38358fca21b26b3723 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 2 Aug 2019 11:45:29 -0700 Subject: [PATCH] openqa/server: fixes for the AMQP publishing config Signed-off-by: Adam Williamson --- inventory/group_vars/openqa_common | 1 + roles/openqa/server/defaults/main.yml | 3 ++ roles/openqa/server/tasks/main.yml | 33 +++++++++++++++++---- roles/openqa/server/templates/openqa.ini.j2 | 2 +- 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/inventory/group_vars/openqa_common b/inventory/group_vars/openqa_common index 774e0e77f3..599d9e97e1 100644 --- a/inventory/group_vars/openqa_common +++ b/inventory/group_vars/openqa_common @@ -22,6 +22,7 @@ openqa_assetsize_updates: 100 openqa_amqp_passive: true # fedora-messaging publisher settings +openqa_amqp_publisher_prefix: org.fedoraproject.{{ fedmsg_env }} openqa_amqp_publisher_url: "amqps://openqa{{ openqa_env_suffix }}:@rabbitmq{{ openqa_env_suffix }}.fedoraproject.org/%2Fpubsub" # openQA isn't very ssl-aware here, so we're abusing its URL construction # to stuff the cert and key values in here diff --git a/roles/openqa/server/defaults/main.yml b/roles/openqa/server/defaults/main.yml index 88dca41563..f45215d474 100644 --- a/roles/openqa/server/defaults/main.yml +++ b/roles/openqa/server/defaults/main.yml @@ -1 +1,4 @@ openqa_webapi_plugins: FedoraUpdateRestart +openqa_amqp_publisher_prefix: +openqa_amqp_publisher_url: amqp://test:@localhost/%2Fpubsub +openqa_amqp_publisher_exchange: amq.topic diff --git a/roles/openqa/server/tasks/main.yml b/roles/openqa/server/tasks/main.yml index fa8e42da0c..0872dad8df 100644 --- a/roles/openqa/server/tasks/main.yml +++ b/roles/openqa/server/tasks/main.yml @@ -18,6 +18,9 @@ ## default - ansible_nodename # - openqa_webapi_plugins ## string - Space-separated list of openQA WebAPI plugins to enable +## Note if you enable FedoraMessaging or AMQP plugins, you should +## also set openqa_amqp_publisher_prefix, openqa_amqp_publisher_url +## and openqa_amqp_publisher_exchange ## default - FedoraUpdateRestart # Optional vars @@ -41,15 +44,35 @@ ## (upstream default is 100GB). Lower is recommended for normal ## Fedora testing, 50GB is good ## FIXME: this only works for pgsql ATM +# - openqa_amqp_publisher_prefix +## string - openQA AMQP 'topic_prefix' config value. This prefix is +## prepended to the topic when publishing messages with the +## AMQP or FedoraMessaging plugins, with a . added (so don't +## include the . in the value). If set to an empty string, +## openQA from before August 2019 will use 'suse' as the +## prefix; later openQA will omit the prefix entirely +## default - '' (empty string) +# - openqa_amqp_publisher_url +## string - AMQP broker URL for publishing messages with the AMQP or +## FedoraMessaging plugins, e.g. +## amqps://fedora:@rabbitmq.fedoraproject.org/%2Fpubsub +## default - amqp://test:@localhost/%2Fpubsub +# - openqa_amqp_publisher_exchange +## string - exchange to publish AMQP messages to with AMQP or +## FedoraMessaging plugins, e.g. amq.topic. Note, this can +## be (ab)used to set additional query parameters for the +## publish request, by just appending them, e.g. +## amq.topic&cacertfile=/path/to/ca_certificate_file +## default - amq.topic # - deployment_type ## string - Fedora Infrastructure thing; for this role, applies an ## infra-specific tweak to httpd config. Don't set it outside ## Fedora infra. -# -# If openqa_dbhost is set, the others must be too, and the server will be -# configured to use a pgsql database accordingly. If openqa_dbhost is not -# set, the server will use a local SQLite database and the other values -# are ignored. + +# If openqa_dbhost is set, the other openqa_db* variables must be too, +# and the server will be configured to use a pgsql database accordingly. +# If openqa_dbhost is not set, the server will use a local SQLite database +# and the other openqa_db* values are ignored. - name: Create geekotest group with static GID group: "name=geekotest gid={{ openqa_static_uid }} system=yes" diff --git a/roles/openqa/server/templates/openqa.ini.j2 b/roles/openqa/server/templates/openqa.ini.j2 index 2bba2888d5..aa87a2e9c7 100644 --- a/roles/openqa/server/templates/openqa.ini.j2 +++ b/roles/openqa/server/templates/openqa.ini.j2 @@ -9,7 +9,7 @@ hide_asset_types = repo iso hdd parallel_cancel_whole_cluster = 0 [amqp] -topic_prefix = fedora +topic_prefix = {{ openqa_amqp_publisher_prefix }} url = {{ openqa_amqp_publisher_url }} exchange = {{ openqa_amqp_publisher_exchange }}