From aa2a002a965607231227085663cd9a00df507160 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Sat, 21 Nov 2020 18:37:03 -0800 Subject: [PATCH] Change how we get the HTML file accessible in fedora_nightlies Just can't get Apache config Alias to work for some reason, so let's go with the flow and stick the file in openQA's public directory. This works! Signed-off-by: Adam Williamson --- inventory/group_vars/fedora_nightlies | 5 ++--- .../openqa-extras-fedora_nightlies.inc.httpd | 1 - roles/fedora_nightlies/tasks/main.yml | 15 ++++++--------- .../templates/fedora_nightlies.toml.j2 | 8 ++++++-- .../openqa/server/templates/openqa.conf.httpd.j2 | 1 - 5 files changed, 14 insertions(+), 16 deletions(-) delete mode 100644 roles/fedora_nightlies/files/openqa-extras-fedora_nightlies.inc.httpd diff --git a/inventory/group_vars/fedora_nightlies b/inventory/group_vars/fedora_nightlies index c5289eb229..c5139845f6 100644 --- a/inventory/group_vars/fedora_nightlies +++ b/inventory/group_vars/fedora_nightlies @@ -2,15 +2,14 @@ # to create queues on the infra AMQP broker, by broker config fedora_nightlies_amqp_passive: true -# fedora-messaging job scheduler settings: most of these are the same -# for prod and stg as they both must listen for prod messages. Only -# the queue names differs +# fedora-messaging job scheduler settings fedora_nightlies_amqp_url: "amqps://openqa:@rabbitmq.fedoraproject.org/%2Fpubsub" fedora_nightlies_amqp_cacert: /etc/fedora-messaging/cacert.pem fedora_nightlies_amqp_key: /etc/pki/fedora-messaging/openqa-key.pem fedora_nightlies_amqp_cert: /etc/pki/fedora-messaging/openqa-cert.pem fedora_nightlies_amqp_queue: "openqa_fedora_nightlies" fedora_nightlies_amqp_routing_keys: ["org.fedoraproject.prod.openqa.job.done", "org.fedoraproject.prod.pungi.compose.status.change"] +fedora_nightlies_amqp_html_file: /usr/share/openqa/public/nightlies.html # fedora-messaging email error reporting settings fedora_nightlies_amqp_mailto: ["adamwill@fedoraproject.org"] diff --git a/roles/fedora_nightlies/files/openqa-extras-fedora_nightlies.inc.httpd b/roles/fedora_nightlies/files/openqa-extras-fedora_nightlies.inc.httpd deleted file mode 100644 index 35813b4540..0000000000 --- a/roles/fedora_nightlies/files/openqa-extras-fedora_nightlies.inc.httpd +++ /dev/null @@ -1 +0,0 @@ -Alias /nightlies.html "/var/www/fedora_nightlies/nightlies.html" diff --git a/roles/fedora_nightlies/tasks/main.yml b/roles/fedora_nightlies/tasks/main.yml index 2038e9dc0d..1d552f11b5 100644 --- a/roles/fedora_nightlies/tasks/main.yml +++ b/roles/fedora_nightlies/tasks/main.yml @@ -66,6 +66,12 @@ ## string - Fedora Infrastructure thing; for this role, applies an ## infra-specific tweak to httpd config. Don't set it outside ## Fedora infra. +# - fedora_nightlies_amqp_data_file +## string - Full path of JSON file to generate/read. If not set, +## fedora_nightlies default will be used +# - fedora_nightlies_amqp_html_file +## string - Full path of HTML file to generate. If not set, +## fedora_nightlies default will be used - name: Install required packages @@ -147,12 +153,3 @@ - name: Enable and start fedora-messaging fedora_nightlies service: name=fm-consumer@fedora_nightlies enabled=yes state=started when: not fedora_nightlies_disabled|bool - -# This is also icky and assumes something is Including this config snippet, -# i.e. a Fedora infra-y openQA server. But making it better is a bit hard -- name: Set up Apache config - copy: src=openqa-extras-fedora_nightlies.inc.httpd dest=/etc/httpd/conf.d/openqa-extras-fedora_nightlies.inc owner=root group=root mode=0644 - notify: - - reload httpd - tags: - - config diff --git a/roles/fedora_nightlies/templates/fedora_nightlies.toml.j2 b/roles/fedora_nightlies/templates/fedora_nightlies.toml.j2 index 44a8114ad0..573e950191 100644 --- a/roles/fedora_nightlies/templates/fedora_nightlies.toml.j2 +++ b/roles/fedora_nightlies/templates/fedora_nightlies.toml.j2 @@ -45,10 +45,14 @@ routing_keys = [{% for key in fedora_nightlies_amqp_routing_keys %}"{{ key }}",{ [consumer_config] # JSON data file location. If not set, default # /var/lib/fedora_nightlies/nightlies.json will be used -#datafile = "/tmp/nightlies.json" +{% if fedora_nightlies_amqp_data_file is defined %} +datafile = {{ fedora_nightlies_amqp_data_file }} +{% endif %} # HTML output file location. If not set, default # /var/www/fedora_nightlies/nightlies.html will be used -#htmlfile = "/tmp/nightlies.html" +{% if fedora_nightlies_amqp_html_file is defined %} +htmlfile = {{ fedora_nightlies_amqp_html_file }} +{% endif %} [qos] prefetch_size = 0 diff --git a/roles/openqa/server/templates/openqa.conf.httpd.j2 b/roles/openqa/server/templates/openqa.conf.httpd.j2 index 1627a89f1d..7557a2c446 100644 --- a/roles/openqa/server/templates/openqa.conf.httpd.j2 +++ b/roles/openqa/server/templates/openqa.conf.httpd.j2 @@ -7,5 +7,4 @@ ProxyPass /apache-status ! {% endif %} Include conf.d/openqa-common.inc - IncludeOptional conf.d/openqa-extras-*.inc