From 50ed152ab946146b89c33f7dad2d3d55828e1f4e Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Fri, 21 Dec 2018 02:44:49 +0100 Subject: [PATCH] win_updates: Correctly report changes on success (#50188) * win_updates: Correctly report changes on success * Add changelog fragment --- .../fragments/50185-win_updates-report-changes-correctly.yml | 3 +++ lib/ansible/modules/windows/win_updates.ps1 | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 changelogs/fragments/50185-win_updates-report-changes-correctly.yml diff --git a/changelogs/fragments/50185-win_updates-report-changes-correctly.yml b/changelogs/fragments/50185-win_updates-report-changes-correctly.yml new file mode 100644 index 0000000000..fe8873933d --- /dev/null +++ b/changelogs/fragments/50185-win_updates-report-changes-correctly.yml @@ -0,0 +1,3 @@ +--- +bugfixes: +- win_updates - Correctly report changes on success diff --git a/lib/ansible/modules/windows/win_updates.ps1 b/lib/ansible/modules/windows/win_updates.ps1 index b9df9d1610..ff9df50322 100644 --- a/lib/ansible/modules/windows/win_updates.ps1 +++ b/lib/ansible/modules/windows/win_updates.ps1 @@ -350,6 +350,10 @@ $update_script_block = { $result.installed_update_count = $update_success_count $result.failed_update_count = $update_fail_count + if ($updates_success_count -gt 0) { + $result.changed = $true + } + if ($update_fail_count -gt 0) { $result.failed = $true $result.msg = "Failed to install one or more updates"