From 826c2e0862fd568a2cc1eb808d8ecb36b1b9a670 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Thu, 19 Sep 2019 19:20:02 +0800 Subject: shadowsocks: Use the 'service' module instead of ad-hoc command --- roles/shadowsocks/handlers/main.yml | 4 +++- roles/shadowsocks/tasks/main.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/roles/shadowsocks/handlers/main.yml b/roles/shadowsocks/handlers/main.yml index f165bc8..280568b 100644 --- a/roles/shadowsocks/handlers/main.yml +++ b/roles/shadowsocks/handlers/main.yml @@ -1,3 +1,5 @@ --- - name: restart-shadowsocks - command: service shadowsocks restart + service: + name: shadowsocks + state: restarted diff --git a/roles/shadowsocks/tasks/main.yml b/roles/shadowsocks/tasks/main.yml index bd22af4..c911135 100644 --- a/roles/shadowsocks/tasks/main.yml +++ b/roles/shadowsocks/tasks/main.yml @@ -36,7 +36,9 @@ notify: restart-shadowsocks - name: start service - command: service shadowsocks start + service: + name: shadowsocks + state: started - name: show client-side config vars: -- cgit v1.2.2