openqa_dispatcher: revise for fedmsg hub consumer

ditch the old systemd consumer service, install the fedmsg
consumer config file, add some fedmsg-hub reload notifications.
This commit is contained in:
Adam Williamson 2016-03-07 12:06:41 -08:00
parent 73da02a655
commit 651061ea10
3 changed files with 23 additions and 9 deletions

View file

@ -31,6 +31,7 @@
dnf: name={{ item }} state=present
with_items:
- fedfind
- python2-fedmsg-consumers
- python-setuptools
- python-six
tags:

View file

@ -0,0 +1,3 @@
config = {
'fedora_openqa_schedule.consumer.enabled': True,
}

View file

@ -25,6 +25,7 @@
dnf: name={{ item }} state=present
with_items:
- fedfind
- python2-fedmsg-consumers
- python2-wikitcms
- python-requests
- python-setuptools
@ -71,10 +72,8 @@
args:
chdir: /root/openqa_fedora_tools-dispatcher/scheduler
when: "gittools|changed or not insttools.stat.exists"
- name: Reload systemd config to pick up installed units
command: "systemctl daemon-reload"
when: "gittools|changed or not insttools.stat.exists"
notify:
- restart fedmsg-hub
- name: openQA client config
template: src=client.conf.j2 dest=/etc/openqa/client.conf owner=root group=fedmsg mode=0640
@ -98,10 +97,21 @@
tags:
- config
- name: Enable and start consumer
service: name=openqa-consumer.service enabled=yes state=started
- name: Disable and stop old consumer service
service: name=openqa-consumer.service enabled=no state=stopped
when: "openqa_consumer is defined and openqa_consumer"
- name: Restart consumer if code changed
service: name=openqa-consumer.service state=restarted
when: "gittools|changed"
- name: Remove old service if present
file: path=/usr/lib/systemd/system/openqa-consumer.service state=absent
register: serviceremove
- name: Reload systemd to remove old service if removed
command: "systemctl daemon-reload"
when: "serviceremove|changed"
- name: Enable fedmsg consumer
copy: src=openqa_consumer.py dest=/etc/fedmsg.d/openqa_consumer.py openqa_consumer.py
notify:
- restart fedmsg-hub
tags:
- config