roles/common: re-format handlers

Use the newer Ansible format.
This commit is contained in:
Alan Orth 2023-08-23 21:35:28 +03:00
parent 17736a4f14
commit 84d210cfab
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -2,19 +2,26 @@
# ansible.builtin.file: roles/common/handlers/main.yml # ansible.builtin.file: roles/common/handlers/main.yml
- name: reload sshd - name: reload sshd
ansible.builtin.systemd: name={{ sshd_service_name }} state=reloaded ansible.builtin.systemd:
name: "{{ sshd_service_name }}"
state: reloaded
- name: reload sysctl - name: reload sysctl
command: sysctl -p /etc/sysctl.conf command: sysctl -p /etc/sysctl.conf
- name: reload systemd - name: reload systemd
ansible.builtin.systemd: daemon_reload=true ansible.builtin.systemd:
daemon_reload: true
- name: restart nftables - name: restart nftables
ansible.builtin.systemd: name=nftables state=restarted ansible.builtin.systemd:
name: nftables
state: restarted
# 2021-09-28: note to self to keep fail2ban at the end, as handlers are executed # 2021-09-28: note to self to keep fail2ban at the end, as handlers are executed
# in the order they are defined, not in the order they are listed in the task's # in the order they are defined, not in the order they are listed in the task's
# notify statement and we must restart fail2ban after updating the firewall. # notify statement and we must restart fail2ban after updating the firewall.
- name: restart fail2ban - name: restart fail2ban
ansible.builtin.systemd: name=fail2ban state=restarted ansible.builtin.systemd:
name: fail2ban
state: restarted