From 5416c5dfd8172980cbd412964a16c520f8224456 Mon Sep 17 00:00:00 2001 From: igor-belousov <139464423+igor-belousov@users.noreply.github.com> Date: Thu, 15 Jan 2026 14:04:16 +0300 Subject: [PATCH] fix(podman_prune): set top-level changed status (#997) * fix(podman_prune): set top-level changed status The module was returning changed status inside nested dicts, but Ansible expects it at the top level of the result. Before: {"image": {"changed": true, ...}} -> Ansible sees changed=false After: {"changed": true, "image": {...}} -> Ansible sees changed=true Signed-off-by: Igor Belousov * Update plugins/modules/podman_prune.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Igor Belousov --------- Signed-off-by: Igor Belousov Co-authored-by: Igor Belousov Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- plugins/modules/podman_prune.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/modules/podman_prune.py b/plugins/modules/podman_prune.py index 99b9a36..202132d 100644 --- a/plugins/modules/podman_prune.py +++ b/plugins/modules/podman_prune.py @@ -251,7 +251,10 @@ def main(): system_filters["system_volumes"] = "--volumes" results[target] = podmanExec(module, target, system_filters, executable) - module.exit_json(**results) + # Calculate global changed status from all targets + changed = any(res.get("changed", False) for res in results.values()) + + module.exit_json(changed=changed, **results) if __name__ == "__main__":