From 1ef512244d61c4b5917de1d9456ac4d4e22eeafc Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 30 Mar 2016 17:13:57 -0700 Subject: [PATCH] openqa: u-t not needed, more generic compatibility necessary updates for openqa roles have gone stable for now, so disable updates-testing usage (keep the plays around commented, though, since we'll likely need them again in future). Also, a bit more attempted support for non-infra use: make the monkey patching of the repo URLs in the test templates only happen if deployment_type is defined, actually respect the openqa_consumer var (don't enable the job scheduling consumer unless it's truey) and only enable any wiki reporting consumer if deployment_type is defined. --- roles/openqa/dispatcher/tasks/main.yml | 30 ++++++++++++------ .../templates/openqa_consumer.py.j2 | 8 +++-- roles/openqa/server/tasks/main.yml | 31 ++++++++++++------- 3 files changed, 44 insertions(+), 25 deletions(-) diff --git a/roles/openqa/dispatcher/tasks/main.yml b/roles/openqa/dispatcher/tasks/main.yml index c0642c1921..cc5188fe14 100644 --- a/roles/openqa/dispatcher/tasks/main.yml +++ b/roles/openqa/dispatcher/tasks/main.yml @@ -12,9 +12,18 @@ ## string - FAS username for reporting results to wiki # - wikitcms_password ## string - password for relval_user +# - deployment_type +## string - Fedora Infrastructure thing; for this role, decides +## whether and where to submit wiki results # -# When both of the above are set, a wikitcms 'credentials' file will -# be created and result submission to the wiki will be enabled. +# When all of the above are set, a wikitcms 'credentials' file will +# be created and result submission to the wiki will be enabled. If +# deployment_type is set to 'prod', results will be submitted to the +# production wiki in response to openQA production 'job complete' +# fedmsgs; if set to 'stg', results will be submitted to the staging +# wiki in response to openQA staging 'job complete' fedmsgs. You +# probably should NOT set these unless you're maintaining the Fedora +# infrastructure deployments. # # NOTE: There are still currently a couple of assumptions that the # openQA server boxes will always act as their own dispatchers, but @@ -22,22 +31,23 @@ # as we now use the openQA asset downloading capability so that the # scheduler is no longer responsible for downloading assets. -# note: we need updates-testing until fedfind/wikitcms 2.x go stable -- name: Install required packages (testing) - dnf: name={{ item }} state=present enablerepo="updates-testing" - with_items: - - fedfind - - python2-wikitcms - tags: - - packages +# just keeping this around for convenience as we often need it +#- name: Install required packages (testing) +# dnf: name={{ item }} state=present enablerepo="updates-testing" +# with_items: + +# tags: +# - packages - name: Install required packages dnf: name={{ item }} state=present with_items: + - fedfind - python2-fedmsg-consumers - python-requests - python-setuptools - python-six + - python2-wikitcms tags: - packages diff --git a/roles/openqa/dispatcher/templates/openqa_consumer.py.j2 b/roles/openqa/dispatcher/templates/openqa_consumer.py.j2 index 7e7d12c51d..c70c41b02a 100644 --- a/roles/openqa/dispatcher/templates/openqa_consumer.py.j2 +++ b/roles/openqa/dispatcher/templates/openqa_consumer.py.j2 @@ -1,10 +1,12 @@ config = { +{% if openqa_consumer %} 'fedora_openqa_schedule.consumer.enabled': True, +{% endif $} {% if wikitcms_user is defined and wikitcms_password is defined %} -{% if deployment_type == 'stg' %} - 'fedora_openqa_schedule.wiki.consumer.stg.enabled': True, -{% else %} +{% if deployment_type is defined and deployment_type == 'prod' %} 'fedora_openqa_schedule.wiki.consumer.prod.enabled': True, +{% elif deployment_type is defined and deployment_type == 'stg' %} + 'fedora_openqa_schedule.wiki.consumer.stg.enabled': True, {% endif %} {% endif %} } diff --git a/roles/openqa/server/tasks/main.yml b/roles/openqa/server/tasks/main.yml index 1d196b153f..fb6b4c83a2 100644 --- a/roles/openqa/server/tasks/main.yml +++ b/roles/openqa/server/tasks/main.yml @@ -32,6 +32,12 @@ # - openqa_assetsize ## int - the asset size limit to set in GB (upstream default is 100GB) ## higher is recommended for normal Fedora testing, 300GB is good +## FIXME: this only works for pgsql ATM +# - deployment_type +## string - Fedora Infrastructure thing; for this role, decides +## whether to monkeypatch the repo URLs in the templates +## to work inside Fedora infrastructure. Don't set it +## unless your deployment is running in 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 @@ -54,17 +60,13 @@ shell: /sbin/nologin when: "openqa_static_uid is defined" -# note: we need updates-testing until fedfind 2.x and openQA 4.3-21 go stable -- name: Install required packages (testing) - dnf: name={{ item }} state=present enablerepo="updates-testing" - with_items: - - python2-fedfind - - python3-fedfind - - openqa - - openqa-httpd - - openqa-plugin-fedmsg - tags: - - packages +# just keeping this around for convenience as we often need it +#- name: Install required packages (testing) +# dnf: name={{ item }} state=present enablerepo="updates-testing" +# with_items: +# +# tags: +# - packages - name: Install required packages dnf: name={{ item }} state=present enablerepo=adamwill-openQA @@ -80,6 +82,11 @@ - expect - libguestfs-tools-c - libguestfs-xfs + - openqa + - openqa-httpd + - openqa-plugin-fedmsg + - python2-fedfind + - python3-fedfind - python3-libguestfs - python3-pexpect tags: @@ -205,7 +212,7 @@ - name: Patch repo URLs in templates shell: "cp /var/lib/openqa/share/tests/fedora/templates /tmp && sed -i -e 's,dl.fedoraproject,dl.phx2.fedoraproject,g' /tmp/templates" - when: "gittests|changed" + when: "gittests|changed and deployment_type is defined" changed_when: "1 != 1" - name: Dump existing config for checking changes