From 25e6469e4da6a6b3fad50efc79aba8a377c10a2c Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 4 Mar 2016 14:25:46 -0800 Subject: [PATCH] check-compose: switch to fedmsg-hub based fedmsg consumer I'm switching the misc. QA fedmsg consumers over to using fedmsg- hub, due to https://github.com/fedora-infra/fedmsg/issues/365 . So we need to adjust how we install check-compose, install a config file to enable the consumer, and also set up the fedmsg base and hub roles on the openqa server boxes (which do the check-compose job ATM). --- playbooks/groups/openqa.yml | 2 ++ .../check-compose/files/checkcomp_consumer.py | 3 +++ roles/check-compose/tasks/main.yml | 23 ++++++------------- 3 files changed, 12 insertions(+), 16 deletions(-) create mode 100644 roles/check-compose/files/checkcomp_consumer.py diff --git a/playbooks/groups/openqa.yml b/playbooks/groups/openqa.yml index ce698e92ce..117fa17823 100644 --- a/playbooks/groups/openqa.yml +++ b/playbooks/groups/openqa.yml @@ -43,6 +43,8 @@ roles: - { role: openqa/server, tags: ['openqa_server'] } - { role: openqa/dispatcher, tags: ['openqa_dispatcher'] } + - { role: fedmsg/base, tags: ['fedmsg_base'] } + - { role: fedmsg/hub, tags: ['fedmsg_hub'] } - { role: check-compose, tags: ['check-compose'] } handlers: diff --git a/roles/check-compose/files/checkcomp_consumer.py b/roles/check-compose/files/checkcomp_consumer.py new file mode 100644 index 0000000000..5d3068cffb --- /dev/null +++ b/roles/check-compose/files/checkcomp_consumer.py @@ -0,0 +1,3 @@ +config = { + 'checkcomp_consumer.prod.enabled': True, +} diff --git a/roles/check-compose/tasks/main.yml b/roles/check-compose/tasks/main.yml index 1fef4e146e..2f4b6761bd 100644 --- a/roles/check-compose/tasks/main.yml +++ b/roles/check-compose/tasks/main.yml @@ -62,27 +62,18 @@ dest: /root/fedora-qa register: gitqa -- name: Clean check-compose - command: "make prefix=/usr clean" - args: - chdir: /root/fedora-qa/check-compose - when: "gitqa|changed" - -- name: Build check-compose - command: "make prefix=/usr" - args: - chdir: /root/fedora-qa/check-compose - when: "gitqa|changed" - - name: Install check-compose - command: "make prefix=/usr install" + command: "python setup.py install" args: chdir: /root/fedora-qa/check-compose when: "gitqa|changed" -- name: Reload systemd config to pick up installed units - command: "systemctl daemon-reload" - when: "gitqa|changed" +- name: Enable fedmsg consumer + copy: src=checkcomp_consumer.py dest=/etc/fedmsg.d/checkcomp_consumer.py owner=root group=root mode=0644 + notify: + - restart fedmsg-hub + tags: + - config - name: Install config file template: src=check-compose.conf.j2 dest=/etc/check-compose.conf mode=0644