When the option json() is turned on, a not successful execution has its output in on stdout and not on stderr.
I am not sure whats the best way to get around the issue, that a failing execution does not output anything
Option 1:
Check in runProcess if the ANSIBLE_STDOUT_CALLBACK is set to json and then return $process->getOutput() instead of $process->getErrorOutput().
Option 2:
Make the process accesible from the outside and make the user responsible to get the right output
Option 3:
just always return $process->getOutput() (don't know how it's without json enabled)
When the option
json()is turned on, a not successful execution has its output in onstdoutand not onstderr.I am not sure whats the best way to get around the issue, that a failing execution does not output anything
Option 1:
Check in
runProcessif theANSIBLE_STDOUT_CALLBACKis set tojsonand then return$process->getOutput()instead of$process->getErrorOutput().Option 2:
Make the process accesible from the outside and make the user responsible to get the right output
Option 3:
just always return
$process->getOutput()(don't know how it's withoutjsonenabled)