Module "Warning" after upgrade to v. 2.2

972 views
Skip to first unread message

Dimitri Yioulos

unread,
Nov 30, 2016, 4:40:56 PM11/30/16
to Ansible Project
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
<sawintest02> ESTABLISH WINRM CONNECTION FOR USER: ansible on PORT 5986 TO sawintest02
<sawintest02> EXEC Set-StrictMode -Version Latest
(New-Item -Type Directory -Path $env:temp -Name "ansible-tmp-1480539501.17-123206679591223").FullName | Write-Host -Separator '';
<sawintest02> PUT "/tmp/tmpxodTis" TO "C:\Users\ansible\AppData\Local\Temp\ansible-tmp-1480539501.17-123206679591223\win_updates.ps1"
<sawintest02> 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.

Danny Rehelis

unread,
Dec 2, 2016, 7:23:39 AM12/2/16
to ansible...@googlegroups.com
I got the same JSON junk warnings with win_updates after updating... What this warning mean? What junk exactly?

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/4c7242ad-6630-4763-9bd3-5b7475f98be2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Danny Rehelis - autogun [AT] gmail.com

Matt Davis

unread,
Dec 2, 2016, 5:15:42 PM12/2/16
to Ansible Project
It's nothing you need to worry about- due to some changes in the module JSON sanitizer in 2.2, it's a little more sensitive than it used to be, so some modules are tripping it that didn't used to. Those warnings are there because sometimes there is actual spurious output from the module guts that signifies an error (you'd see the actual output in the message too, if there were anything to worry about). 

We don't currently have a consistent way to fail module tests when one of those warnings gets shown, but it's on the list of things to do, so meantime it's a game of whack-a-mole to find them and clean them up as we see them. If you want to file bugs for them when you spot them, it'd be helpful for us (since we're not in the habit of running all modules interactively looking for warnings). If you're willing to do thay, you might want to wait for the module repo consolidation that's happening next week (after which you can file it on http://github.com/ansible/ansible).

-Matt
Message has been deleted

Dimitri Yioulos

unread,
Dec 6, 2016, 9:37:20 AM12/6/16
to Ansible Project
Thank you, Matt.  As long as the errors aren't playbook killers, I can live with them, in the short-term anyway.  I will file bugs as I encounter them.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages