mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-04-27 20:12:54 +08:00
In ansible 2.8 the - character isn't supposed to be valid in group names. While we could override this, might has well just bite the bullet and change it. So, just switch all group names to use _ instead of - Signed-off-by: Kevin Fenzi <kevin@scrye.com>
89 lines
2.3 KiB
YAML
89 lines
2.3 KiB
YAML
---
|
|
# Setup a fedmsg-hub
|
|
|
|
- name: install needed packages
|
|
package: name=fedmsg-hub state=present
|
|
tags:
|
|
- packages
|
|
when: "'python34_fedmsg' not in group_names and ansible_distribution_major_version|int < 22"
|
|
|
|
- name: install needed packages
|
|
dnf: pkg=fedmsg-hub state=present
|
|
tags:
|
|
- packages
|
|
when: "'python34_fedmsg' not in group_names and ansible_distribution_major_version|int > 21"
|
|
|
|
- name: install the python34 fedmsg package (yum)
|
|
package: name=python34-fedmsg-core state=present
|
|
when: "'python34_fedmsg' in group_names and ansible_distribution_major_version|int < 22"
|
|
tags: fedmsg/base
|
|
|
|
- name: install the python3 fedmsg package (dnf)
|
|
dnf: pkg=python3-fedmsg state=present
|
|
when: "'python34_fedmsg' in group_names and ansible_distribution_major_version|int > 21"
|
|
tags: fedmsg/base
|
|
|
|
- name: fedmsg-hub service
|
|
service: name=fedmsg-hub state=started enabled=yes
|
|
when: "'python34_fedmsg' not in group_names"
|
|
|
|
- name: fedmsg-hub-3 service
|
|
service: name=fedmsg-hub-3 state=started enabled=yes
|
|
when: "'python34_fedmsg' in group_names"
|
|
|
|
- name: enable the websocket server if we should
|
|
copy: src=websockets.py dest=/etc/fedmsg.d/websockets.py
|
|
when: enable_websocket_server
|
|
notify: restart fedmsg-hub
|
|
|
|
- name: disable the websocket server if we should..
|
|
file: dest=/etc/fedmsg.d/websockets.py state=absent
|
|
when: not enable_websocket_server
|
|
notify: restart fedmsg-hub
|
|
|
|
- name: set fedmsg ownership on /var/run/fedmsg
|
|
file: >
|
|
dest=/var/run/fedmsg/
|
|
mode=2775
|
|
owner=fedmsg
|
|
group=fedmsg
|
|
state=directory
|
|
tags:
|
|
- fedmsgmonitor
|
|
|
|
- name: ensure that nrpe has rights to monitor us
|
|
file: >
|
|
dest=/var/run/fedmsg/monitoring-fedmsg-hub.socket
|
|
mode=0775
|
|
owner=fedmsg
|
|
group=nrpe
|
|
state=file
|
|
ignore_errors: true
|
|
notify:
|
|
- restart nrpe
|
|
tags:
|
|
- fedmsgmonitor
|
|
|
|
- name: create systemd config directoryies
|
|
file: path="/etc/systemd/system/{{ item }}.service.d" state=directory
|
|
with_items:
|
|
- fedmsg-hub
|
|
- fedmsg-hub-3
|
|
notify:
|
|
- reload systemd
|
|
tags:
|
|
- fedmsg/hub
|
|
|
|
- name: install systemd config file
|
|
template:
|
|
src: fedmsg-hub-systemd.conf.j2
|
|
dest: "/etc/systemd/system/{{ item }}.service.d/systemd.conf"
|
|
with_items:
|
|
- fedmsg-hub
|
|
- fedmsg-hub-3
|
|
notify:
|
|
- reload systemd
|
|
- restart fedmsg-hub
|
|
tags:
|
|
- fedmsg/hub
|