A role for bugzilla2fedmsg.

This commit is contained in:
Ralph Bean 2014-06-24 14:32:06 +00:00
parent c760b15d9f
commit e3f8c50b23
8 changed files with 121 additions and 21 deletions

View file

@ -103,3 +103,6 @@
- name: run rkhunter
command: rkhunter --propupd
- name: restart moksha-hub
service: name=moksha-hub state=restarted

View file

@ -7,7 +7,7 @@ freezes: false
# for systems that do not match the above - specify the same parameter in
# the host_vars/$hostname file
tcp_ports: [ 3000 ]
tcp_ports: [ 3000, 3001 ]
fas_client_groups: sysadmin-noc,sysadmin-datanommer

View file

@ -7,7 +7,7 @@ num_cpus: 1
# for systems that do not match the above - specify the same parameter in
# the host_vars/$hostname file
tcp_ports: [ 3000 ]
tcp_ports: [ 3000, 3001 ]
fas_client_groups: sysadmin-noc,sysadmin-datanommer

View file

@ -48,22 +48,22 @@
handlers:
- include: "{{ handlers }}/restart_services.yml"
#- name: dole out the service-specific config
# hosts: bugzilla2fedmsg;bugzilla2fedmsg-stg
# user: root
# gather_facts: True
# accelerate: "{{ accelerated }}"
#
# roles:
# - fedmsg/hub
# - bugzilla2fedmsg
# - role: collectd/fedmsg-service
# process: fedmsg-hub
#
# vars_files:
# - /srv/web/infra/ansible/vars/global.yml
# - "{{ private }}/vars.yml"
# - "{{ vars_path }}/{{ ansible_distribution }}.yml"
#
# handlers:
# - include: "{{ handlers }}/restart_services.yml"
- name: dole out the service-specific config
hosts: bugzilla2fedmsg;bugzilla2fedmsg-stg
user: root
gather_facts: True
accelerate: "{{ accelerated }}"
roles:
- bugzilla2fedmsg
# This is going to be way different
#- role: collectd/fedmsg-service
# process: fedmsg-hub
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "{{ private }}/vars.yml"
- "{{ vars_path }}/{{ ansible_distribution }}.yml"
handlers:
- include: "{{ handlers }}/restart_services.yml"

View file

@ -0,0 +1,13 @@
[Unit]
Description=Generic moksha processing hub
After=network.target
Documentation=http://moksha.ws/
[Service]
ExecStart=/usr/bin/moksha-hub /etc/bugzilla2fedmsg.ini
Type=simple
User=fedmsg
Group=fedmsg
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,53 @@
---
# Setup a fedmsg-hub
- name: install needed packages
yum: pkg={{ item }} state=installed
with_items:
- python-moksha-hub
- python-bugzilla2fedmsg
- python-twisted-words
tags:
- packages
- name: Copy a custom moksha systemd service file
copy: >
src=moksha-hub.service
dest=/usr/lib/systemd/system/fedmsg-hub.service
notify:
- restart moksha-hub
- name: Copy the configuration for bugzilla2fedmsg over
template: >
src=bugzilla2fedmsg.ini
dest=/etc/bugzilla2fedmsg.ini
owner=fedmsg
group=fedmsg
mode=0640
notify:
- restart moksha-hub
- name: Copy in the staging certificates
copy: >
src="{{ private }}/files/bugzilla2fedmsg/{{ item }}"
dest="/etc/pki/fedmsg/{{ item }}"
with_items:
- fedora.devel.engineering.redhat.com.crt
- fedora.devel.engineering.redhat.com.key
when: env == 'staging'
notify:
- restart moksha-hub
- name: Copy in the production certificates
copy: >
src="{{ private }}/files/bugzilla2fedmsg/{{ item }}"
dest="/etc/pki/fedmsg/{{ item }}"
with_items:
- fuse-fabric-fedoraproject.org.crt
- fuse-fabric-fedoraproject.org.key
when: env != 'staging'
notify:
- restart moksha-hub
- name: moksha-hub service
service: name=moksha-hub state=started enabled=yes

View file

@ -0,0 +1,30 @@
# moksha configuration without fedmsg
[app:main]
# Some configuration for our workers
bugzilla.products = Fedora, Fedora EPEL
# If you have 8 worker threads you *also* need 8 fedmsg endpoints in fedmsg.d/
# and 8 open holes in the firewall
bugzilla.num_workers = 2
# These are credentials used to log in to bugzilla
bugzilla.url = https://bugzilla.redhat.com
bugzilla.username = {{ bugzilla_user }}
bugzilla.password = {{ bugzilla_password }}
# Stomp broker configuration.
{% if env == 'staging %}
stomp_uri = fuse-fabric-01.stg.jboss.org:61617,fuse-fabric-02.stg.jboss.org:61617,fuse-fabric-03.stg.jboss.org:61617
stomp_ssl_crt = /etc/fedmsg/pki/fedora.devel.engineering.redhat.com.crt
stomp_ssl_key = /etc/fedmsg/pki/fedora.devel.engineering.redhat.com.key
{% else %}
stomp_uri = fuse-fabric-01.jboss.org:61617,fuse-fabric-02.jboss.org:61617,fuse-fabric-03.jboss.org:61617
stomp_ssl_crt = /etc/fedmsg/pki/fuse-fabric-fedoraproject.org.crt
stomp_ssl_key = /etc/fedmsg/pki/fuse-fabric-fedoraproject.org.key
{% endif %}
stomp_user = {{ redhat_dmz_broker_username }}
stomp_pass = {{ redhat_dmz_broker_password }}

View file

@ -8,6 +8,7 @@ config = dict(
endpoints={
"bugzilla2fedmsg.bugzilla2fedmsg01": [
"tcp://bugzilla2fedmsg01.%s:3000" % suffix,
"tcp://bugzilla2fedmsg01.%s:3001" % suffix,
],
},
)