-
Notifications
You must be signed in to change notification settings - Fork 57
Closed
Description
Line 3 in 10b165c
| command: semodule -R |
Running ansible via cron does not detect where semodule is located:
RUNNING HANDLER [fedora.linux_system_roles.selinux : Reload SELinux policy] ****
--
fatal: [localhost]: FAILED! => \{"changed": true, "cmd": "semodule -R", "msg": "[Errno 2] No such file or directory: b'semodule'", "rc": 2, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
PLAY RECAP *********************************************************************
localhost : ok=232 changed=144 unreachable=0 failed=1 skipped=174 rescued=0 ignored=7
But if the code is changed to the following, there's no issue:
- command: semodule -R
+ command: /usr/sbin/semodule -R
Result:
RUNNING HANDLER [fedora.linux_system_roles.selinux : Reload SELinux policy] ****
changed: [localhost]
... more lines ...
PLAY RECAP *********************************************************************
localhost : ok=247 changed=147 unreachable=0 failed=0 skipped=174 rescued=0 ignored=7
A more future proof way might be to which semodule and use that output to run the command?
Metadata
Metadata
Assignees
Labels
No labels