ansible/roles/fedmsg/base/tasks/main.yml

126 lines
3.4 KiB
YAML
Raw Normal View History

---
# tasklist for setting up fedmsg
# This is the base set of files needed for fedmsg
- name: install needed packages
yum: pkg={{ item }} state=installed
with_items:
- fedmsg
2014-02-19 17:25:50 +00:00
- libsemanage-python
- python-psutil
- policycoreutils-python # This is in the kickstart now. Here for old hosts.
tags:
- packages
- 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
tags:
- config
# 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.
- name: setup basic /etc/fedmsg.d/ contents
template: >
src="{{ item }}.j2"
dest="/etc/fedmsg.d/{{ item }}"
owner=root
group=root
mode=644
with_items:
- ssl.py
- endpoints.py
2014-01-28 18:51:52 +00:00
- endpoints-fedocal.py
- endpoints-elections.py
- endpoints-fedbadges.py
- endpoints-fmn-web.py
- 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
- endpoints-kerneltest.py
- endpoints-fedimg.py
- endpoints-github2fedmsg.py
- endpoints-bugzilla2fedmsg.py
- relay.py
- pkgdb.py
- logging.py
- base.py
tags:
- config
- fedmsgdconfig
notify:
- restart httpd
- restart fedmsg-gateway
- restart fedmsg-hub
- restart fedmsg-irc
- restart fedmsg-relay
- 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
tags:
- config
- name: install fedmsg ca.cert
2013-09-27 13:59:29 +00:00
copy: >
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
tags:
- config
- 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"
dest=/etc/pki/fedmsg/
mode=644
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 != []
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"
dest=/etc/pki/fedmsg/
2013-09-27 13:59:50 +00:00
mode=0640
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 != []
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
# 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
always_run: yes
changed_when: "1 != 1"
- 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