mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-07-08 19:49:09 +00:00
fix(launchd): restarted and reloaded always report changed
Both actions unconditionally execute commands (unload/load/start), so changed must always be True in non-check mode, regardless of whether the PID or state happened to match before and after. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
38399c8107
commit
cd6b128253
1 changed files with 3 additions and 0 deletions
|
|
@ -501,6 +501,9 @@ def main():
|
|||
# Run the requested task
|
||||
if not module.check_mode:
|
||||
state, pid, status_code, err = tasks[action].run()
|
||||
# restarted and reloaded always perform commands unconditionally, so they always change state
|
||||
if action in ("restarted", "reloaded"):
|
||||
result["changed"] = True
|
||||
|
||||
result["status"]["current_state"] = ServiceState.to_string(state)
|
||||
result["status"]["current_pid"] = pid
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue