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