ansible/roles/common/handlers/main.yaml

32 lines
626 B
YAML

---
- name: update grub
ansible.builtin.command:
cmd: update-grub
- name: reboot
ansible.builtin.reboot:
- name: apt update
ansible.builtin.apt:
update_cache: true
- name: daemon reload
ansible.builtin.systemd:
daemon_reload: true
- name: reload sshd
ansible.builtin.systemd:
name: ssh
state: reloaded
- name: reload nginx
ansible.builtin.systemd:
name: nginx
state: reloaded
- name: persist iptables
ansible.builtin.shell: "{{ item.c }}-save > /etc/iptables/rules.{{ item.ip }}"
with_items:
- { c: iptables, ip: v4 }
- { c: ip6tables, ip: v6 }
when: not nft | bool