From 455af49b80e423e104aee0d1f59cbeb4e5193314 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Mon, 24 Jun 2019 19:02:30 -0700 Subject: [PATCH] check-compose: try to rejig email recipients for new system I changed how check-compose upstream does email recipient config to try and fix the 'get Atomic-related emails to Atomic people' problem again after Fedora-Atomic composes went away. This is an attempt to adjust the play to populate the config file for that change. Let's see what blows up! Signed-off-by: Adam Williamson --- inventory/group_vars/checkcompose | 5 ++-- roles/check-compose/tasks/main.yml | 26 ++++++++++++------- .../templates/check-compose.conf.j2 | 11 +++----- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/inventory/group_vars/checkcompose b/inventory/group_vars/checkcompose index 568d81cb2b..ccbbca8550 100644 --- a/inventory/group_vars/checkcompose +++ b/inventory/group_vars/checkcompose @@ -8,8 +8,9 @@ checkcompose_env: production # if additional systems were added to this group. checkcompose_emailfrom: rawhide@fedoraproject.org checkcompose_emailto: "test@lists.fedoraproject.org devel@lists.fedoraproject.org" -checkcompose_atomic_emailto: "dusty@dustymabe.com walters@verbum.org atomic@lists.fedoraproject.org" -checkcompose_atomic_emailerror: "true" +checkcompose_subvariant_emails: + AtomicHost: + error: "dusty@dustymabe.com walters@verbum.org atomic@lists.fedoraproject.org" checkcompose_smtp: bastion.phx2.fedoraproject.org checkcompose_url: "https://{{ external_hostname }}" checkcompose_greenwaveurl: https://greenwave-web-greenwave.app.os.fedoraproject.org diff --git a/roles/check-compose/tasks/main.yml b/roles/check-compose/tasks/main.yml index 1514fdd3bb..98494fe0f2 100644 --- a/roles/check-compose/tasks/main.yml +++ b/roles/check-compose/tasks/main.yml @@ -65,17 +65,25 @@ ## string - (digits) time in minutes to wait for openQA tests to complete ## before sending the report (defaults to 480) # - checkcompose_emailfrom -## string - Email address to send report from (if not set, no report sent) +## string - Email address to send reports from (if not set, no reports +## sent) # - checkcompose_emailto -## string - Email address to send report to (if not set but email-from -## set, report will go to email-from, for testing usually) +## string - Email address to send all reports to. Split multiple +## addresses with spaces +# - checkcompose_subvariant_emails +## dict - Per-subvariant recipients foe check-compose emails. Should +## be a dict of dicts like this: +## { +## 'Workstation': { +## 'all': ['foo@workstation.com', 'bar@workstation.com'], +## 'error': ['error@workstation.com'], +## }, +## 'Server': { +## 'all': ['foo@server.com'], +## 'error': ['error@server.com'], +## }, +## } ## Split multiple addresses with spaces -# - checkcompose_atomic_emailto -## string - Email address to send report for Fedora-Atomic composes to -## Split multiple addresses with spaces -# - checkcompose_atomic_emailerror -## string - Set to 'true' if reports for Fedora-Atomic composes should -## only be mailed out if any tests did not pass # - checkcompose_smtp ## string - SMTP server to use for sending the report # - checkcompose_json diff --git a/roles/check-compose/templates/check-compose.conf.j2 b/roles/check-compose/templates/check-compose.conf.j2 index 4d480416d8..0606fac625 100644 --- a/roles/check-compose/templates/check-compose.conf.j2 +++ b/roles/check-compose/templates/check-compose.conf.j2 @@ -26,10 +26,7 @@ json: {{ checkcompose_json }} {% if checkcompose_loglevel is defined %} loglevel: {{ checkcompose_loglevel }} {% endif %} -[Fedora-Atomic] -{% if checkcompose_atomic_emailto is defined %} -email-to: {{ checkcompose_atomic_emailto }} -{% endif %} -{% if checkcompose_atomic_emailerror is defined %} -email-error: {{ checkcompose_atomic_emailerror }} -{% endif %} +{% for subv, recdict in checkcompose_subvariant_emails.items() %} +[{{ subv }}] +{% for rectype, recips in recdict %} +{{ rectype }}: {{ recips|join(' ') }}