Report Autocloud results to ResultsDB
Parking this on openqa01 because I *think* it's authed for RDB and I don't know if Autocloud boxes are.
This commit is contained in:
parent
0a6f0f79ad
commit
8c9a781992
6 changed files with 67 additions and 4 deletions
2
inventory/group_vars/autocloudreporter
Normal file
2
inventory/group_vars/autocloudreporter
Normal file
|
@ -0,0 +1,2 @@
|
|||
# This var should never be set for more than one machine
|
||||
autocloudreporter_prod: true
|
|
@ -637,6 +637,12 @@ openqa01.qa.fedoraproject.org
|
|||
[relvalconsumer-test]
|
||||
openqa-stg01.qa.fedoraproject.org
|
||||
|
||||
# This group should only ever contain *ONE* system
|
||||
# It should probably be autocloud itself, but I dunno if that box
|
||||
# is authorized for ResultsDB currently
|
||||
[autocloudreporter]
|
||||
openqa01.qa.fedoraproject.org
|
||||
|
||||
[resultsdb:children]
|
||||
resultsdb-dev
|
||||
resultsdb-stg
|
||||
|
|
|
@ -40,16 +40,18 @@
|
|||
- "/srv/private/ansible/vars.yml"
|
||||
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
|
||||
|
||||
# relvalconsumer isn't particularly related to openQA in any way,
|
||||
# we just put that role on these boxes as they're handy and there's
|
||||
# nowhere more obviously correct.
|
||||
# relvalconsumer and autocloudreporter aren't particularly related
|
||||
# to openQA in any way, we just put those role on these boxes. There's
|
||||
# nowhere more obviously correct for rvc and acr should be on an
|
||||
# Autocloud box but I don't know if they're authed for RDB.
|
||||
roles:
|
||||
- { role: openqa/server, tags: ['openqa_server'] }
|
||||
- { role: openqa/dispatcher, tags: ['openqa_dispatcher'] }
|
||||
- { role: check-compose, tags: ['check-compose'] }
|
||||
- { role: relvalconsumer, tags: ['relvalconsumer'] }
|
||||
- { role: fedmsg/base, tags: ['fedmsg_base', 'fedmsg'] }
|
||||
- { role: fedmsg/hub, tags: ['fedmsg_hub', 'fedmsg'] }
|
||||
- { role: relvalconsumer, tags: ['relvalconsumer'] }
|
||||
- { role: autocloudreporter, tags: ['autocloudreporter'] }
|
||||
|
||||
handlers:
|
||||
- include: "{{ handlers }}/restart_services.yml"
|
||||
|
|
1
roles/autocloudreporter/defaults/main.yml
Normal file
1
roles/autocloudreporter/defaults/main.yml
Normal file
|
@ -0,0 +1 @@
|
|||
autocloudreporter_prod: false
|
43
roles/autocloudreporter/tasks/main.yml
Normal file
43
roles/autocloudreporter/tasks/main.yml
Normal file
|
@ -0,0 +1,43 @@
|
|||
# This role reports Autocloud results to ResultsDB. There should
|
||||
# always be exactly one host in infra with this role set up and
|
||||
# autocloudreporter_prod set to True, so all results are reported
|
||||
# once.
|
||||
#
|
||||
# Required vars
|
||||
#
|
||||
# Required vars with defaults
|
||||
# - autocloudreporter_prod
|
||||
## bool - whether this is the production instance. **SHOULD ONLY
|
||||
## EVER BE TRUE ON ONE SYSTEM IN THE WORLD**
|
||||
## default - False
|
||||
|
||||
- name: Install required packages
|
||||
dnf: name={{ item }} state=present
|
||||
with_items:
|
||||
- python2-fedfind
|
||||
- python2-fedmsg-consumers
|
||||
- python2-resultsdb_api
|
||||
- python-setuptools
|
||||
tags:
|
||||
- packages
|
||||
|
||||
- name: Check out autocloudreporter
|
||||
git:
|
||||
repo: https://pagure.io/fedora-qa/autocloudreporter.git
|
||||
dest: /root/autocloudreporter
|
||||
register: gitacr
|
||||
|
||||
- name: Install autocloudreporter
|
||||
command: "python setup.py install"
|
||||
args:
|
||||
chdir: /root/autocloudreporter
|
||||
when: "gitacr|changed"
|
||||
notify:
|
||||
- restart fedmsg-hub
|
||||
|
||||
- name: Enable fedmsg consumer
|
||||
template: src=autocloudreporter.py.j2 dest=/etc/fedmsg.d/autocloudreporter.py owner=root group=root mode=0644
|
||||
notify:
|
||||
- restart fedmsg-hub
|
||||
tags:
|
||||
- config
|
|
@ -0,0 +1,9 @@
|
|||
config = {
|
||||
{% if autocloudreporter_prod %}
|
||||
'autocloudreporter.prod.enabled': True,
|
||||
'autocloudreporter.test.enabled': False,
|
||||
{% else %}
|
||||
'autocloudreporter.prod.enabled': False,
|
||||
'autocloudreporter.test.enabled': False,
|
||||
{% endif %}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue