add a check-compose role and activate it on openqa servers
I just killed the old BOS openqa deployment, which sends out those 'compose check' emails, so I'm gonna go ahead and have this new openqa deployment start sending out those emails a little earlier than planned. This should result in both prod and staging openqa running a compose check each day, but only prod should actually send out an email report.
This commit is contained in:
parent
b0736cd244
commit
09afa5ce5f
4 changed files with 87 additions and 1 deletions
|
@ -17,7 +17,9 @@ openqa_secret: "{{ prod_openqa_apisecret }}"
|
||||||
wikitcms_user: coconut
|
wikitcms_user: coconut
|
||||||
wikitcms_password: "{{ prod_wikitcms_password }}"
|
wikitcms_password: "{{ prod_wikitcms_password }}"
|
||||||
|
|
||||||
openqa_workers: 3
|
check-compose_email-from: rawhide@fedoraproject.org
|
||||||
|
check-compose_email-to: "test@lists.fedoraproject.org devel@lists.fedoraproject.org"
|
||||||
|
check-compose_smtp: bastion.phx2.fedoraproject.org
|
||||||
|
|
||||||
deployment_type: prod
|
deployment_type: prod
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@
|
||||||
roles:
|
roles:
|
||||||
- { role: openqa/server, tags: ['openqa_server'] }
|
- { role: openqa/server, tags: ['openqa_server'] }
|
||||||
- { role: openqa/dispatcher, tags: ['openqa_dispatcher'] }
|
- { role: openqa/dispatcher, tags: ['openqa_dispatcher'] }
|
||||||
|
- { role: check-compose, tags: ['check-compose'] }
|
||||||
|
|
||||||
handlers:
|
handlers:
|
||||||
- include: "{{ handlers }}/restart_services.yml"
|
- include: "{{ handlers }}/restart_services.yml"
|
||||||
|
|
70
roles/check-compose/tasks/main.yml
Normal file
70
roles/check-compose/tasks/main.yml
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
# Optional vars
|
||||||
|
# - check-compose_wait
|
||||||
|
## string - (digits) time in minutes to wait for openQA tests to complete
|
||||||
|
## before sending the report (defaults to 480)
|
||||||
|
# - check-compose_email-from
|
||||||
|
## string - Email address to send report from (if not set, no report sent)
|
||||||
|
# - check-compose_email-to
|
||||||
|
## string - Email address to send report to (if not set but email-from
|
||||||
|
## set, report will go to email-from, for testing usually)
|
||||||
|
## Split multiple addresses with spaces
|
||||||
|
# - check-compose_smtp
|
||||||
|
## string - SMTP server to use for sending the report
|
||||||
|
# - check-compose_json
|
||||||
|
## string - File to append JSON-formatted report summary to
|
||||||
|
# - check-compose_loglevel
|
||||||
|
## string - log level
|
||||||
|
#
|
||||||
|
# NOTE: this is missing /etc/openqa/client.conf configuration, for now;
|
||||||
|
# we're assuming it'll be deployed on the openqa server boxes and hence
|
||||||
|
# client.conf will be in place (and localhost default would be correct
|
||||||
|
# anyhow)
|
||||||
|
|
||||||
|
- name: Install required packages
|
||||||
|
dnf: name={{ item }} state=present
|
||||||
|
with_items:
|
||||||
|
- fedfind
|
||||||
|
- python-six
|
||||||
|
tags:
|
||||||
|
- packages
|
||||||
|
|
||||||
|
- name: Check out openQA-python-client
|
||||||
|
git:
|
||||||
|
repo: https://github.com/os-autoinst/openQA-python-client.git
|
||||||
|
dest: /root/openQA-python-client
|
||||||
|
register: gitclient
|
||||||
|
|
||||||
|
- name: Check if python-client has ever been installed
|
||||||
|
command: "python -c 'import openqa_client'"
|
||||||
|
register: instclient
|
||||||
|
changed_when: "1 != 1"
|
||||||
|
failed_when: "1 != 1"
|
||||||
|
|
||||||
|
- name: Install openQA-python-client
|
||||||
|
command: "python setup.py install"
|
||||||
|
args:
|
||||||
|
chdir: /root/openQA-python-client
|
||||||
|
when: "gitclient|changed or instclient.rc > 0"
|
||||||
|
|
||||||
|
- name: Check out fedora-qa (where check-compose lives)
|
||||||
|
git:
|
||||||
|
repo: https://git.fedorahosted.org/git/fedora-qa.git
|
||||||
|
dest: /root/fedora-qa
|
||||||
|
register: gitqa
|
||||||
|
|
||||||
|
- name: Install check-compose
|
||||||
|
command: "make install"
|
||||||
|
args:
|
||||||
|
chdir: /root/fedora-qa/check-compose
|
||||||
|
when: "gitqa|changed"
|
||||||
|
|
||||||
|
- name: Install config file
|
||||||
|
template: src=check-compose.conf.j2 dest=/etc/check-compose.conf mode=0644
|
||||||
|
tags:
|
||||||
|
- config
|
||||||
|
|
||||||
|
- name: Enable and start timers
|
||||||
|
service: name=check-compose-{{ item }}.timer enabled=yes state=started
|
||||||
|
with_items:
|
||||||
|
- branched
|
||||||
|
- rawhide
|
13
roles/check-compose/templates/check-compose.conf.j2
Normal file
13
roles/check-compose/templates/check-compose.conf.j2
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
[main]
|
||||||
|
{% if check-compose_wait is defined %}
|
||||||
|
wait: {{ check-compose_wait }}
|
||||||
|
{% if check-compose_email-from is defined %}
|
||||||
|
email-from: {{ check-compose_email-from }}
|
||||||
|
{% if check-compose_email-to is defined %}
|
||||||
|
email-to: {{ check-compose_email-to }}
|
||||||
|
{% if check-compose_smtp is defined %}
|
||||||
|
smtp: {{ check-compose_smtp }}
|
||||||
|
{% if check-compose_json is defined %}
|
||||||
|
json: {{ check-compose_json }}
|
||||||
|
{% if check-compose_loglevel is defined %}
|
||||||
|
loglevel: {{ check-compose_loglevel }}
|
Loading…
Add table
Add a link
Reference in a new issue