Yes, got the same error with json out module as:
serverA: mymodule2.ps1
#!/usr/bin/powershell
# WANT_JSON
# POWERSHELL_COMMON
$result = New-Object psobject
Set-Attr $result "msg" "test"
Exit-Json $result
ServerA$ansible ServerB -m mymodule2.ps1
FAILED! => {
"changed": false,
"failed": true,
"module_stderr": "",
"module_stdout": "\u001b[?1h\u001b={\"msg\":\"test\"}\r\n",
"msg": "MODULE FAILURE",
"parsed": false
}
On Monday, October 24, 2016 at 1:05:34 PM UTC-5, J Hawkesworth wrote:
>
> You'll still need to get powershell to return json to standard out,
> otherwise ansible will not be able to understand what happened when your
> module ran.
>
> Matt Martz's example above is about as simple as a module could be - the
> Exit-Json cmdlet returns the $result object as JSON.
>
> Hope this helps,
>
>
>
--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/e6038312-f43e-4191-ba08-6dc20b5b8459%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.