2013-06-07 20:01:23 +00:00
|
|
|
---
|
|
|
|
# tasklist for setting up fedmsg
|
|
|
|
# This is the base set of files needed for fedmsg
|
|
|
|
|
2013-06-13 15:31:57 +00:00
|
|
|
- name: install needed packages
|
2014-01-01 19:15:11 +00:00
|
|
|
yum: pkg={{ item }} state=installed
|
2013-06-13 15:31:57 +00:00
|
|
|
with_items:
|
|
|
|
- fedmsg
|
2014-02-19 17:25:50 +00:00
|
|
|
- libsemanage-python
|
2014-02-27 14:48:49 +00:00
|
|
|
- python-psutil
|
2014-03-14 15:59:20 +00:00
|
|
|
- policycoreutils-python # This is in the kickstart now. Here for old hosts.
|
2013-06-13 15:31:57 +00:00
|
|
|
tags:
|
|
|
|
- packages
|
|
|
|
|
2013-06-07 20:01:23 +00:00
|
|
|
- name: setup /etc/fedmsg.d directory
|
2013-06-07 20:07:56 +00:00
|
|
|
file: path=/etc/fedmsg.d owner=root group=root mode=0755 state=directory
|
2013-06-07 20:01:23 +00:00
|
|
|
tags:
|
|
|
|
- config
|
|
|
|
|
2014-03-14 15:30:32 +00:00
|
|
|
# Any files that change need to restart any services that depend on them. A
|
|
|
|
# trick here is that some hosts have an httpd that uses fedmsg, while others do
|
|
|
|
# not. Some hosts have a fedmsg-hub that uses this config, while others do not.
|
|
|
|
# Our handlers in handlers/restart_services.yml are smart enough to
|
|
|
|
# *conditionally* restart these services, only if they are installed on the
|
|
|
|
# system.
|
2013-06-13 15:31:57 +00:00
|
|
|
- name: setup basic /etc/fedmsg.d/ contents
|
2014-03-14 15:30:32 +00:00
|
|
|
template: >
|
|
|
|
src="{{ item }}.j2"
|
|
|
|
dest="/etc/fedmsg.d/{{ item }}"
|
|
|
|
owner=root
|
|
|
|
group=root
|
|
|
|
mode=644
|
2013-06-13 15:31:57 +00:00
|
|
|
with_items:
|
|
|
|
- ssl.py
|
|
|
|
- endpoints.py
|
2014-01-28 18:51:52 +00:00
|
|
|
- endpoints-fedocal.py
|
2014-06-16 17:17:18 +02:00
|
|
|
- endpoints-elections.py
|
2013-06-14 04:40:01 +00:00
|
|
|
- endpoints-fedbadges.py
|
2014-06-11 19:01:59 +00:00
|
|
|
- endpoints-fmn-web.py
|
2014-07-07 14:20:27 +00:00
|
|
|
- endpoints-fmn-backend.py
|
2013-09-26 14:30:04 +00:00
|
|
|
- endpoints-nuancier.py
|
2013-11-07 14:37:15 +00:00
|
|
|
- endpoints-mailman.py
|
2014-02-19 17:25:50 +00:00
|
|
|
- endpoints-summershum.py
|
2014-06-16 18:47:15 +00:00
|
|
|
- endpoints-kerneltest.py
|
2014-07-09 14:15:47 +00:00
|
|
|
- endpoints-fedimg.py
|
2014-06-16 18:47:15 +00:00
|
|
|
- endpoints-github2fedmsg.py
|
2014-06-23 20:22:01 +00:00
|
|
|
- endpoints-bugzilla2fedmsg.py
|
2013-06-13 15:31:57 +00:00
|
|
|
- relay.py
|
|
|
|
- pkgdb.py
|
|
|
|
- logging.py
|
|
|
|
- base.py
|
|
|
|
tags:
|
|
|
|
- config
|
2014-05-28 17:24:06 +00:00
|
|
|
- fedmsgdconfig
|
2014-03-14 15:30:32 +00:00
|
|
|
notify:
|
|
|
|
- restart httpd
|
|
|
|
- restart fedmsg-gateway
|
|
|
|
- restart fedmsg-hub
|
|
|
|
- restart fedmsg-irc
|
|
|
|
- restart fedmsg-relay
|
2013-06-13 15:31:57 +00:00
|
|
|
|
2013-06-07 20:01:23 +00:00
|
|
|
- name: setup /etc/pki/fedmsg directory
|
2013-06-07 20:07:56 +00:00
|
|
|
file: path=/etc/pki/fedmsg owner=root group=root mode=0755 state=directory
|
2013-06-07 20:01:23 +00:00
|
|
|
tags:
|
|
|
|
- config
|
|
|
|
|
|
|
|
- name: install fedmsg ca.cert
|
2013-09-27 13:59:29 +00:00
|
|
|
copy: >
|
2014-01-01 19:15:11 +00:00
|
|
|
src="{{ puppet_private }}/fedmsg-certs/keys/ca.crt"
|
2013-09-27 13:59:29 +00:00
|
|
|
dest=/etc/pki/fedmsg/ca.crt
|
|
|
|
owner=root
|
|
|
|
group=root
|
|
|
|
mode=0644
|
2013-06-07 20:01:23 +00:00
|
|
|
tags:
|
|
|
|
- config
|
|
|
|
|
2013-06-18 03:13:11 +00:00
|
|
|
- name: fedmsg certs
|
|
|
|
copy: >
|
2014-07-10 19:11:31 +00:00
|
|
|
src="{{ private }}/files/fedmsg-certs/keys/{{item['service']}}-{{fedmsg_fqdn | default(ansible_fqdn)}}.crt"
|
2013-06-18 03:13:11 +00:00
|
|
|
dest=/etc/pki/fedmsg/
|
|
|
|
mode=644
|
2013-06-18 03:14:30 +00:00
|
|
|
owner={{item['owner']}}
|
|
|
|
group={{item['group']}}
|
2014-01-01 20:03:52 +00:00
|
|
|
with_items:
|
|
|
|
- "{{ fedmsg_certs }}"
|
2013-06-18 04:16:57 +00:00
|
|
|
when: fedmsg_certs != []
|
2013-06-18 03:13:11 +00:00
|
|
|
tags:
|
|
|
|
- config
|
|
|
|
|
|
|
|
- name: fedmsg keys
|
|
|
|
copy: >
|
2014-07-10 19:11:31 +00:00
|
|
|
src="{{ private }}/files/fedmsg-certs/keys/{{item['service']}}-{{fedmsg_fqdn | default(ansible_fqdn)}}.key"
|
2013-06-18 03:13:11 +00:00
|
|
|
dest=/etc/pki/fedmsg/
|
2013-09-27 13:59:50 +00:00
|
|
|
mode=0640
|
2013-06-18 03:14:30 +00:00
|
|
|
owner={{item['owner']}}
|
|
|
|
group={{item['group']}}
|
2014-01-01 20:03:52 +00:00
|
|
|
with_items:
|
|
|
|
- "{{ fedmsg_certs }}"
|
2013-06-18 04:16:57 +00:00
|
|
|
when: fedmsg_certs != []
|
2013-06-18 03:13:11 +00:00
|
|
|
tags:
|
|
|
|
- config
|
2014-01-28 19:51:26 +00:00
|
|
|
|
|
|
|
# Three tasks for handling our custom selinux module
|
|
|
|
- name: ensure a directory exists for our custom selinux module
|
|
|
|
file: dest=/usr/local/share/fedmsg state=directory
|
|
|
|
|
|
|
|
- name: copy over our custom selinux module
|
|
|
|
copy: src=selinux/fedmsg.pp dest=/usr/local/share/fedmsg/fedmsg.pp
|
|
|
|
register: selinux_module
|
|
|
|
|
|
|
|
- name: install our custom selinux module
|
2014-01-28 19:57:21 +00:00
|
|
|
command: semodule -i /usr/local/share/fedmsg/fedmsg.pp
|
2014-01-28 19:51:26 +00:00
|
|
|
when: selinux_module|changed
|
2014-03-03 17:02:58 +00:00
|
|
|
|
|
|
|
# Also, label the ports that we commonly use for fedmsg under mod_wsgi
|
|
|
|
# to be http_port_t so selinux lets apache bind there.
|
|
|
|
- name: check semanage ports
|
|
|
|
command: semanage port -l
|
|
|
|
register: semanageoutput
|
2014-05-27 22:26:23 +00:00
|
|
|
always_run: yes
|
|
|
|
changed_when: "1 != 1"
|
2014-03-03 17:02:58 +00:00
|
|
|
|
|
|
|
- name: set ports so httpd can bind to fedmsg endpoints
|
|
|
|
command: semanage port -a -t http_port_t -p tcp 3000-3100
|
|
|
|
when: semanageoutput.stdout.find("3000-3100") == -1
|