From cd6b128253dd090592a155b83bffa7d8167ad917 Mon Sep 17 00:00:00 2001 From: Alexei Znamensky Date: Sat, 30 May 2026 21:40:13 +1200 Subject: [PATCH] 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 --- plugins/modules/launchd.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/modules/launchd.py b/plugins/modules/launchd.py index 64a1375a40..a2abcafdac 100644 --- a/plugins/modules/launchd.py +++ b/plugins/modules/launchd.py @@ -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