From e4a3f49fa2641e8d2013e3699b98f8ae9573bb01 Mon Sep 17 00:00:00 2001 From: jeromew Date: Tue, 17 Dec 2013 11:42:00 -0500 Subject: [PATCH] ssh_alt - only trigger 'fatal' when returncode == 255 (interpreted as 'could no connect') --- lib/ansible/runner/connection_plugins/ssh_alt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/runner/connection_plugins/ssh_alt.py b/lib/ansible/runner/connection_plugins/ssh_alt.py index df759ec558c..7b40cb7e4ce 100644 --- a/lib/ansible/runner/connection_plugins/ssh_alt.py +++ b/lib/ansible/runner/connection_plugins/ssh_alt.py @@ -272,7 +272,7 @@ class Connection(object): controlpersisterror = stderr.find('Bad configuration option: ControlPersist') != -1 or stderr.find('unknown configuration option: ControlPersist') != -1 if p.returncode != 0 and controlpersisterror: raise errors.AnsibleError('using -c ssh on certain older ssh versions may not support ControlPersist, set ANSIBLE_SSH_ARGS="" (or ansible_ssh_args in the config file) before running again') - if p.returncode != 0 and in_data: + if p.returncode == 255 and in_data: raise errors.AnsibleError('SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh') return (p.returncode, '', stdout, stderr)