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:
parent
73da02a655
commit
651061ea10
3 changed files with 23 additions and 9 deletions
|
@ -31,6 +31,7 @@
|
||||||
dnf: name={{ item }} state=present
|
dnf: name={{ item }} state=present
|
||||||
with_items:
|
with_items:
|
||||||
- fedfind
|
- fedfind
|
||||||
|
- python2-fedmsg-consumers
|
||||||
- python-setuptools
|
- python-setuptools
|
||||||
- python-six
|
- python-six
|
||||||
tags:
|
tags:
|
||||||
|
|
3
roles/openqa/dispatcher/files/openqa_consumer.py
Normal file
3
roles/openqa/dispatcher/files/openqa_consumer.py
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
config = {
|
||||||
|
'fedora_openqa_schedule.consumer.enabled': True,
|
||||||
|
}
|
|
@ -25,6 +25,7 @@
|
||||||
dnf: name={{ item }} state=present
|
dnf: name={{ item }} state=present
|
||||||
with_items:
|
with_items:
|
||||||
- fedfind
|
- fedfind
|
||||||
|
- python2-fedmsg-consumers
|
||||||
- python2-wikitcms
|
- python2-wikitcms
|
||||||
- python-requests
|
- python-requests
|
||||||
- python-setuptools
|
- python-setuptools
|
||||||
|
@ -71,10 +72,8 @@
|
||||||
args:
|
args:
|
||||||
chdir: /root/openqa_fedora_tools-dispatcher/scheduler
|
chdir: /root/openqa_fedora_tools-dispatcher/scheduler
|
||||||
when: "gittools|changed or not insttools.stat.exists"
|
when: "gittools|changed or not insttools.stat.exists"
|
||||||
|
notify:
|
||||||
- name: Reload systemd config to pick up installed units
|
- restart fedmsg-hub
|
||||||
command: "systemctl daemon-reload"
|
|
||||||
when: "gittools|changed or not insttools.stat.exists"
|
|
||||||
|
|
||||||
- name: openQA client config
|
- name: openQA client config
|
||||||
template: src=client.conf.j2 dest=/etc/openqa/client.conf owner=root group=fedmsg mode=0640
|
template: src=client.conf.j2 dest=/etc/openqa/client.conf owner=root group=fedmsg mode=0640
|
||||||
|
@ -98,10 +97,21 @@
|
||||||
tags:
|
tags:
|
||||||
- config
|
- config
|
||||||
|
|
||||||
- name: Enable and start consumer
|
- name: Disable and stop old consumer service
|
||||||
service: name=openqa-consumer.service enabled=yes state=started
|
service: name=openqa-consumer.service enabled=no state=stopped
|
||||||
when: "openqa_consumer is defined and openqa_consumer"
|
when: "openqa_consumer is defined and openqa_consumer"
|
||||||
|
|
||||||
- name: Restart consumer if code changed
|
- name: Remove old service if present
|
||||||
service: name=openqa-consumer.service state=restarted
|
file: path=/usr/lib/systemd/system/openqa-consumer.service state=absent
|
||||||
when: "gittools|changed"
|
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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue