commit b1c2bdb5fc24a450a4b232055dd5706d7fe52f04
parent c2f84a57cc507596074ad104161b84ede17fb52c
Author: Leah (ctucx) <leah@ctu.cx>
Date: Sun, 21 Feb 2021 18:23:06 +0100
parent c2f84a57cc507596074ad104161b84ede17fb52c
Author: Leah (ctucx) <leah@ctu.cx>
Date: Sun, 21 Feb 2021 18:23:06 +0100
add nftables restart handler
1 file changed, 19 insertions(+), 0 deletions(-)
diff --git a/roles/nftables-handler/handlers/main.yml b/roles/nftables-handler/handlers/main.yml @@ -0,0 +1,19 @@ +--- + +- name: "[OpenRC] Restart service: nftables" + service: + name: nftables + state: restarted + when: + - ansible_service_mgr == "openrc" + - network.nftables.enable is true + listen: "Restart nftables" + +- name: "[systemd] Restart service: nftables" + systemd: + name: nftables + state: restarted + when: + - ansible_service_mgr == "systemd" + - network.nftables.enable is true + listen: "Restart nftables"