Commenting here as suggested in this issue, https://github.com/ansible/ansible/issues/468#issuecomment-6318930
I’d like the option (or default) to parse output from ssh and ignore the case when the hostname isn’t set up correctly. I’m currently setting up images in AWS VPC and as part my initial playbook I setup the hostname, however until it is setup and its new name is propagated in DNS, sudo prepends this text:
“sudo: unable to resolve host”
for example:
ubuntu@ip-10-xx-x-xxx:~$ sudo echo “foo”
sudo: unable to resolve host ip-10-xx-x-xxx
foo
ubuntu@ip-10-xx-x-xxx:~$
It still executes fine, but with that extra text the json parser sees it as a failure.
thanks