fix: redis_status/disable/enable - add user: root, remove sudo, fix grep exit-1
parent
242af7f86f
commit
8356c11139
|
|
@ -846,22 +846,25 @@ actions:
|
|||
message: "${response.out}"
|
||||
redis_status:
|
||||
- cmd[cp]:
|
||||
user: root
|
||||
commands:
|
||||
- sudo systemctl list-units --type=service | grep redis
|
||||
- systemctl list-units --type=service | grep -i redis || echo "No Redis service units found"
|
||||
- return:
|
||||
type: info
|
||||
message: "${response.out}"
|
||||
redis_disable:
|
||||
- cmd[cp]:
|
||||
user: root
|
||||
commands:
|
||||
- sudo systemctl stop redis
|
||||
- systemctl stop redis
|
||||
- return:
|
||||
type: info
|
||||
message: "Redis has been stopped successfully"
|
||||
redis_enable:
|
||||
- cmd[cp]:
|
||||
user: root
|
||||
commands:
|
||||
- sudo systemctl restart redis
|
||||
- systemctl restart redis
|
||||
- return:
|
||||
type: info
|
||||
message: "Redis has been successfully restarted"
|
||||
|
|
|
|||
Loading…
Reference in New Issue