win_updates: action plugin-ify it (#33216)

* converted win_updates to an action plugin for automatic reboots

* do not set final result when running under async

* Updated documentation around win_updates with async and become
This commit is contained in:
Jordan Borean
2018-01-11 14:41:52 +10:00
committed by GitHub
parent 08957cf46e
commit 557716dc49
4 changed files with 315 additions and 24 deletions

View File

@@ -267,15 +267,15 @@ foreach ($update in $updates_to_install) {
}
}
if ($update_fail_count -gt 0) {
Fail-Json -obj $result -msg "Failed to install one or more updates"
}
Write-DebugLog -msg "Performing post-install reboot requirement check..."
$result.reboot_required = Get-RebootStatus
$result.installed_update_count = $update_success_count
$result.failed_update_count = $update_fail_count
if ($update_fail_count -gt 0) {
Fail-Json -obj $result -msg "Failed to install one or more updates"
}
Write-DebugLog -msg "Return value:`r`n$(ConvertTo-Json -InputObject $result -Depth 99)"
Exit-Json $result