Hello, all.
Today, I upgraded Ansible to version 2.2 from version 2.1 via RPM on a CentOS 6.x server. The first playbook I ran post-upgrade contained a play using the win_updates module. It appears the module worked, but I saw the following “Warning” during execution (I could only run the playbook again against a test server that was up-to-date so as to get verbose output) :
Using module file /usr/lib/python2.6/site-packages/ansible/modules/extras/windows/win_updates.ps1
ESTABLISH WINRM CONNECTION FOR USER: ansible on PORT 5986 TO sawintest02
EXEC Set-StrictMode -Version Latest
(New-Item -Type Directory -Path $env:temp -Name “ansible-tmp-1480539501.17-123206679591223”).FullName | Write-Host -Separator ‘’;
PUT “/tmp/tmpxodTis” TO “C:\Users\ansible\AppData\Local\Temp\ansible-tmp-1480539501.17-123206679591223\win_updates.ps1”
EXEC Set-StrictMode -Version Latest
Try
{
& ‘C:\Users\ansible\AppData\Local\Temp\ansible-tmp-1480539501.17-123206679591223\win_updates.ps1’
}
Catch
{
$obj = @{ failed = $true }
If ($.Exception.GetType)
{
$obj.Add(‘msg’, $.Exception.Message)
}
Else
{
$obj.Add(‘msg’, $.ToString())
}
If ($.InvocationInfo.PositionMessage)
{
$obj.Add(‘exception’, $.InvocationInfo.PositionMessage)
}
ElseIf ($.ScriptStackTrace)
{
$obj.Add(‘exception’, $.ScriptStackTrace)
}
Try
{
$obj.Add(‘error_record’, ($ | ConvertTo-Json | ConvertFrom-Json))
}
Catch
{
}
Echo $_obj | ConvertTo-Json -Compress -Depth 99
Exit 1
}
[WARNING]: Module invocation had junk after the JSON data:
ok: [sawintest02] => {
“changed”: false,
“found_update_count”: 0,
“installed_update_count”: 0,
“invocation”: {
“module_name”: “win_updates”
},
“reboot_required”: false,
“updates”: {}
}
What’s the error about, and how can I fix it?
As always, thanks.