Files
fedora-infra_ansible/roles/fedmsg/hub/tasks/main.yml
Michal Konecny 2ec055db6f Use first uppercase letter for all handlers
This will unify all the handlers to use first uppercase letter for
ansible-lint to stop complaining.

I went through all `notify:` occurrences and fixed them by running
```
set TEXT "text_to_replace"; set REPLACEMENT "replacement_text"; git grep
-rlz "$TEXT" . | xargs -0 sed -i "s/$TEXT/$REPLACEMENT/g"
```

Then I went through all the changes and removed the ones that wasn't
expected to be changed.

Fixes https://pagure.io/fedora-infrastructure/issue/12391

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2025-02-10 20:31:49 +00:00

87 lines
2.3 KiB
YAML

---
# Setup a fedmsg-hub
- name: Install needed packages - py2
ansible.builtin.package: name=fedmsg-hub state=present
tags:
- packages
when: "'python34_fedmsg' not in group_names"
- name: Install the python34 fedmsg package (yum)
ansible.builtin.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 and env == 'production'"
- name: Fedmsg-hub service
service: name=fedmsg-hub state=stopped enabled=no
when: "'python34_fedmsg' not in group_names and env == 'staging'"
- 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
ansible.builtin.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..
ansible.builtin.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
ansible.builtin.file: >
dest=/var/run/fedmsg/
mode=2775
owner=fedmsg
group=fedmsg
state=directory
tags:
- fedmsgmonitor
- name: Ensure that nrpe has rights to monitor us
ansible.builtin.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
ansible.builtin.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
ansible.builtin.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