2012-10-08 19:35:54 +00:00
|
|
|
########################################
|
|
|
|
|
# Handlers for restarting services
|
|
|
|
|
#
|
2024-11-27 13:48:08 +10:00
|
|
|
---
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Reload systemd
|
2024-12-19 11:22:24 +10:00
|
|
|
ansible.builtin.command: systemctl daemon-reload
|
2019-02-21 18:58:08 +01:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart apache
|
2024-12-19 11:22:24 +10:00
|
|
|
ansible.builtin.command: /usr/local/bin/conditional-restart.sh httpd httpd
|
2013-05-17 15:55:25 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Reload apache
|
2013-05-17 15:55:25 +00:00
|
|
|
action: service name=httpd state=reloaded
|
|
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart collectd
|
2012-10-17 19:54:24 +00:00
|
|
|
action: service name=collectd state=restarted
|
2012-10-08 19:35:54 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart crond
|
2012-10-17 19:54:24 +00:00
|
|
|
action: service name=crond state=restarted
|
2012-10-08 19:35:54 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart fm-consumer@koji_sync_listener
|
2020-06-11 13:22:49 -04:00
|
|
|
action: service name=fm-consumer@koji_sync_listener state=restarted enabled=yes
|
2020-06-11 13:01:39 -04:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Reload httpd
|
2024-12-19 11:22:24 +10:00
|
|
|
ansible.builtin.command: /usr/local/bin/conditional-reload.sh httpd httpd
|
2013-05-17 15:55:25 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart iptables
|
2013-05-17 15:55:25 +00:00
|
|
|
action: service name=iptables state=restarted
|
2012-10-08 20:34:20 +00:00
|
|
|
|
2025-03-03 14:42:00 -05:00
|
|
|
- name: Restart nftables
|
|
|
|
|
action: service name=nftables state=restarted
|
|
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart ip6tables
|
2015-02-06 21:20:11 +00:00
|
|
|
action: service name=ip6tables state=restarted
|
|
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart libvirtd
|
2013-06-24 20:01:51 +00:00
|
|
|
action: service name=libvirtd state=restarted
|
|
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart virtnetworkd
|
2024-11-22 19:07:37 -08:00
|
|
|
action: service name=virtnetworkd state=restarted
|
|
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart libvirtd.socket
|
2021-04-23 14:18:33 +02:00
|
|
|
action: service name=libvirtd.socket state=stopped
|
2025-02-07 13:51:07 +01:00
|
|
|
notify: Restart libvirtd
|
2021-04-23 14:18:33 +02:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart mailman
|
2013-05-17 15:55:25 +00:00
|
|
|
action: service name=mailman state=restarted
|
2012-10-17 19:54:24 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart named
|
2012-10-17 19:54:24 +00:00
|
|
|
action: service name=named state=restarted
|
|
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart ntpd
|
2012-10-17 19:54:24 +00:00
|
|
|
action: service name=ntpd state=restarted
|
|
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart sshd
|
2018-05-31 18:23:36 +00:00
|
|
|
action: service name=sshd state=restarted
|
|
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart openvpn (Fedora)
|
2014-09-24 17:32:29 +00:00
|
|
|
when: ansible_distribution == "Fedora"
|
2017-05-14 21:38:08 +00:00
|
|
|
action: service name=openvpn-client@openvpn state=restarted
|
2024-11-27 13:48:08 +10:00
|
|
|
# notify:
|
2025-02-07 13:51:07 +01:00
|
|
|
# - Fix openvpn routing
|
2014-09-24 17:32:29 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart openvpn (RHEL7+)
|
2019-09-02 12:14:18 +02:00
|
|
|
when: ansible_distribution == "RedHat" and ansible_distribution_major_version|int >= 7
|
2017-05-14 21:38:08 +00:00
|
|
|
action: service name=openvpn-client@openvpn state=restarted
|
2024-11-27 13:48:08 +10:00
|
|
|
# notify:
|
2025-02-07 13:51:07 +01:00
|
|
|
# - Fix openvpn routing
|
2015-11-04 23:09:43 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Fix openvpn routing
|
2015-11-04 23:19:22 +00:00
|
|
|
action: shell /etc/openvpn/fix-routes.sh
|
2014-06-30 21:12:06 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart xinetd
|
2020-05-14 14:34:16 -07:00
|
|
|
action: service name=xinetd state=restarted
|
2022-05-19 16:31:22 +01:00
|
|
|
when: not inventory_hostname.startswith('proxy')
|
2020-05-14 14:34:16 -07:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart netapproute
|
2013-11-18 20:32:28 +00:00
|
|
|
action: command /etc/sysconfig/network-scripts/ifup-routes eth1
|
2014-02-11 17:25:56 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart network
|
2014-09-23 08:55:26 +00:00
|
|
|
action: service name=network state=restarted
|
|
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Rebuild postfix transport
|
2026-05-08 10:22:29 -07:00
|
|
|
ansible.builtin.command: /usr/sbin/postmap lmdb:/etc/postfix/transport
|
2014-03-12 21:03:02 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Rebuild postfix bysender
|
2026-05-08 10:22:29 -07:00
|
|
|
ansible.builtin.command: /usr/sbin/postmap lmdb:/etc/postfix/bysender
|
2022-07-26 15:58:43 -07:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Rebuild postfix tls_policy
|
2026-05-08 10:22:29 -07:00
|
|
|
ansible.builtin.command: /usr/sbin/postmap lmdb:/etc/postfix/tls_policy
|
2016-09-27 03:08:25 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart postfix
|
2016-09-27 16:35:29 +00:00
|
|
|
service: name=postfix state=restarted
|
|
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Reload proxyhttpd
|
2024-12-19 11:22:24 +10:00
|
|
|
ansible.builtin.command: /usr/local/bin/proxy-conditional-reload.sh httpd httpd
|
2016-12-01 21:36:07 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Run rkhunter
|
2024-12-19 11:22:24 +10:00
|
|
|
ansible.builtin.command: rkhunter --propupd
|
2014-06-24 14:32:06 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart moksha-hub
|
2014-06-24 14:32:06 +00:00
|
|
|
service: name=moksha-hub state=restarted
|
2014-07-10 22:00:31 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart dhcpd
|
2014-07-10 22:00:31 +00:00
|
|
|
service: name=dhcpd state=restarted
|
2014-07-14 21:23:23 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart memcached
|
2014-07-14 21:23:23 +00:00
|
|
|
service: name=memcached state=restarted
|
2014-08-19 15:01:48 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart nagios
|
2024-12-19 16:42:30 +10:00
|
|
|
ansible.builtin.shell: nagios -v /etc/nagios/nagios.cfg && systemctl restart nagios
|
2014-10-08 21:03:20 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart bridge
|
2024-12-19 16:42:30 +10:00
|
|
|
ansible.builtin.shell: /usr/lib/systemd/systemd-sysctl --prefix=/proc/sys/net/bridge
|
2014-11-08 17:07:36 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Reload libvirtd
|
2015-04-28 17:18:14 +00:00
|
|
|
service: name=libvirtd state=reloaded
|
2014-11-08 17:07:36 +00:00
|
|
|
ignore_errors: true
|
2015-04-28 17:18:14 +00:00
|
|
|
when: ansible_virtualization_role == 'host'
|
2014-11-17 15:35:29 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart pagure_ev
|
2017-01-30 22:07:38 +00:00
|
|
|
service: name=pagure_ev state=restarted
|
|
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Update ca-trust
|
2024-12-19 11:22:24 +10:00
|
|
|
ansible.builtin.command: /usr/bin/update-ca-trust
|
2015-03-11 09:15:10 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart stunnel
|
2015-03-17 14:15:13 +00:00
|
|
|
service: name=stunnel state=restarted
|
2015-06-15 19:14:55 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart mirrorlist-server
|
2015-10-15 17:07:17 +00:00
|
|
|
service: name=mirrorlist-server state=restarted
|
2016-02-04 03:48:01 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart NetworkManager
|
2016-02-04 03:48:01 +00:00
|
|
|
service: name=NetworkManager state=restarted
|
|
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Reload NetworkManager-connections
|
2024-12-19 11:22:24 +10:00
|
|
|
ansible.builtin.command: nmcli c reload
|
2016-02-04 03:48:01 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Apply interface-changes
|
2024-12-19 11:22:24 +10:00
|
|
|
ansible.builtin.command: nmcli con up {{ item.split()[1] }}
|
2016-02-04 22:09:06 +00:00
|
|
|
async: 1
|
|
|
|
|
poll: 0
|
2020-04-24 19:21:38 -07:00
|
|
|
loop: "{{ if_uuid.stdout_lines|flatten(levels=1) }}"
|
|
|
|
|
when: item.split()[1] not in ansible_ifcfg_disabled
|
2016-02-04 03:48:01 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Flush journald tmpfiles to persistent store
|
2024-12-19 11:22:24 +10:00
|
|
|
ansible.builtin.command: pkill -f -USR1 systemd-journald
|
2017-03-06 23:12:51 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart idmapd
|
2017-03-06 23:12:51 +00:00
|
|
|
service: name=nfs-idmapd state=restarted
|
2017-07-27 15:00:24 +00:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart buildmaster
|
2018-01-05 15:33:48 +01:00
|
|
|
service: name=buildmaster state=restarted
|
2018-09-12 12:23:10 -04:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart rabbitmq
|
2018-09-12 12:23:10 -04:00
|
|
|
systemd:
|
|
|
|
|
name: rabbitmq-server
|
|
|
|
|
state: restarted
|
2018-10-05 07:39:18 +00:00
|
|
|
daemon_reload: yes
|
2020-05-16 12:01:22 -07:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart chronyd
|
2020-05-16 12:01:22 -07:00
|
|
|
service: name=chronyd state=restarted
|
2021-01-29 14:26:22 -05:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart kojira
|
2021-02-11 09:23:15 -08:00
|
|
|
systemd:
|
|
|
|
|
name: kojira
|
|
|
|
|
state: restarted
|
2021-04-27 16:50:24 +02:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart haveged
|
2021-04-27 16:50:24 +02:00
|
|
|
service: name=haveged state=restarted
|
|
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart obs-signd
|
2021-04-27 16:50:24 +02:00
|
|
|
service: name=signd state=restarted
|
2022-01-23 22:01:14 +01:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart swap.swap
|
2022-01-23 22:01:14 +01:00
|
|
|
service: name="swap.swap" state=restarted
|
2022-06-19 10:25:15 -07:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart varnish
|
2022-06-19 10:25:15 -07:00
|
|
|
service: name=varnish state=restarted
|
2022-06-19 11:19:42 -07:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Reload varnish
|
2022-06-19 11:19:42 -07:00
|
|
|
service: name=varnish state=reload
|
2022-11-29 22:46:43 +01:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart systemd-oomd
|
2022-11-29 22:46:43 +01:00
|
|
|
service: name=systemd-oomd state=reload
|
2023-05-02 17:11:24 -04:00
|
|
|
|
2025-02-07 13:51:07 +01:00
|
|
|
- name: Restart debuginfod
|
2023-05-02 17:11:24 -04:00
|
|
|
service: name=debuginfod state=restarted
|
2025-10-02 13:25:12 +01:00
|
|
|
|
|
|
|
|
# This is allowed to fail when the zabbix agent is not found
|
|
|
|
|
# as it may be triggered from hosts without the zabbix_agent role
|
|
|
|
|
- name: Restart zabbix agent
|
|
|
|
|
ansible.builtin.systemd:
|
|
|
|
|
name: zabbix-agent
|
|
|
|
|
state: restarted
|
|
|
|
|
register: zabbix_restart
|
|
|
|
|
failed_when:
|
|
|
|
|
- zabbix_restart.failed
|
|
|
|
|
- "'Could not find' not in zabbix_restart.msg"
|
2025-10-07 15:10:42 -07:00
|
|
|
|
|
|
|
|
- name: Restart rsyslog
|
|
|
|
|
service: name=rsyslog state=restarted
|