-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
When calling this script via an Ansible task with conditionals setup to check for any output as a Changed or Failed indicator, the conditional is tripped whenever no further updates are available.
Example task parameters:
register: shell_result
changed_when: shell_result.stdout != ""
failed_when: shell_result.stdout != ""Example "failure":
fatal: [host.example.com]: FAILED! => {"changed": true, "failed_when_result": true, "rc": 0, "stderr": "Shared connection to host.example.com closed.\r\n", "stderr_lines": ["Shared connection to host.example.com closed."], "stdout": "\r\n", "stdout_lines": [""]} This stands out:
"stdout": "\r\n""changed": true"failed_when_result": true"rc": 0
The rc value of 0 seems to indicate success, but the conditionals applied that demand no ouput from the script as a success indicator are tripped whenever a (Windows?) EOL is emitted.