resultsdb: install and configure the new ci-resultsdb-listener in staging - step #1

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
Pierre-Yves Chibon 2019-10-18 15:23:25 +02:00
parent 768023c909
commit 51786d8c72
2 changed files with 61 additions and 10 deletions

View file

@ -30,11 +30,33 @@
when: deployment_type == "prod" }
- apache
- { role: fedmsg/base,
when: deployment_type != "dev" }
when: deployment_type == "prod" }
- { role: dnf-automatic, tags: ['dnfautomatic'] }
# Set up for fedora-messaging
- { role: rabbit/user,
username: "resultsdb{{ env_suffix }}"}
- role: rabbit/queue
username: "resultsdb{{ env_suffix }}"
queue_name: "resultsdb{{ env_suffix }}_ci_listener"
routing_keys:
- "org.centos.prod.ci.pipeline.allpackages-build.complete"
- "org.centos.prod.ci.pipeline.allpackages-build.image.complete"
- "org.centos.prod.ci.pipeline.allpackages-build.package.test.functional.complete"
- "org.centos.prod.ci.pipeline.allpackages-build.package.complete"
- "org.centos.prod.ci.pipeline.allpackages-build.package.ignored"
- "org.centos.prod.ci.koji-build.test.queued"
- "org.centos.prod.ci.koji-build.test.running"
- "org.centos.prod.ci.koji-build.test.complete"
- "org.centos.prod.ci.koji-build.test.error"
write_queues:
- "ci"
- "openqa"
vars:
# yes, even the staging scheduler listens to production, it
# has to or else it wouldn't schedule any jobs
env: "production"
env_suffix: ""
tags: ['rabbit']
tasks:
# this is how you include other task lists
@ -78,5 +100,5 @@
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
roles:
- { role: rdbsync, tags: ['rdbsync']}
- { role: rdbsync, tags: ['rdbsync'], when: deployment_type == "prod" }
- { role: ci_resultsdb, tags: ['ci_resultsdb'], when: deployment_type == "stg" }

View file

@ -5,12 +5,16 @@
- python-ci-resultsdb-listener
- libsemanage-python
- rdbsync
when:
- inventory_hostname != "resultsdb-stg01.qa.fedoraproject.org" }
- name: Create /etc/pki/fedmsg/
file: name=/etc/pki/fedmsg
state=directory
recurse=yes
owner=root group=root
when:
- inventory_hostname != "resultsdb-stg01.qa.fedoraproject.org" }
tags:
- config
@ -21,6 +25,8 @@
owner=root
group=root
mode=0644
when:
- inventory_hostname != "resultsdb-stg01.qa.fedoraproject.org" }
tags:
- config
@ -38,19 +44,19 @@
owner=root group=root mode=0644
with_items:
- { file: listener.cfg, location: /etc/ci-resultsdb-listener/ }
- { file: endpoints.py, location: /etc/fedmsg.d/,
when: inventory_hostname != "resultsdb-stg01.qa.fedoraproject.org" }
- { file: ci-resultsdb-listener.py, location: /etc/fedmsg.d/,
when: inventory_hostname != "resultsdb-stg01.qa.fedoraproject.org" }
- { file: settings.py, location: /etc/resultsdb/,
when: inventory_hostname != "resultsdb-stg01.qa.fedoraproject.org" }
- { file: cert.conf, location: /etc/httpd/conf.d/,
when: inventory_hostname != "resultsdb-stg01.qa.fedoraproject.org" }
- { file: endpoints.py, location: /etc/fedmsg.d/ }
- { file: ci-resultsdb-listener.py, location: /etc/fedmsg.d/ }
- { file: settings.py, location: /etc/resultsdb/ }
- { file: cert.conf, location: /etc/httpd/conf.d/ }
when:
- inventory_hostname != "resultsdb-stg01.qa.fedoraproject.org"
notify:
- reload httpd
- name: Start and enable the fedmsg-hub service
service: name={{ item }} enabled=yes state=started
when:
- inventory_hostname != "resultsdb-stg01.qa.fedoraproject.org" }
with_items:
- fedmsg-hub
@ -81,3 +87,26 @@
- config
- certbot
- name: install ci_resultsdb's
package: name={{ item }} state=present
with_items:
- python-ci-resultsdb-listener
when: deployment_type == "stg"
- name: generate ci-resultsdb config files and override default resultsdb settings
template: src={{ item.file }}
dest={{ item.location }}/{{ item.file }}
owner=root group=root mode=0644
with_items:
- { file: listener.cfg, location: /etc/ci-resultsdb-listener/}
- { file: config.toml, location: /etc/fedora-messaging/}
when:
- inventory_hostname == "resultsdb-stg01.qa.fedoraproject.org"
- name: Start and enable the fedora-messaging service
service: name={{ item }} enabled=yes state=started
with_items:
- fm-consumer@config.service
when:
- inventory_hostname == "resultsdb-stg01.qa.fedoraproject.org" }