fix: redis_status/disable/enable - add user: root, remove sudo, fix grep exit-1

main
Anthony 2026-02-28 15:33:10 +08:00
parent 242af7f86f
commit 8356c11139
1 changed files with 6 additions and 3 deletions

View File

@ -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"