From 24e81ddd1c089f7625e5b6f76a705b20a2372d8e Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 29 Sep 2016 17:19:17 -0400 Subject: [PATCH] add ssh error message to failure --- lib/ansible/plugins/connection/ssh.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/ansible/plugins/connection/ssh.py b/lib/ansible/plugins/connection/ssh.py index 98ab6b08fd..53bc05fb27 100644 --- a/lib/ansible/plugins/connection/ssh.py +++ b/lib/ansible/plugins/connection/ssh.py @@ -148,9 +148,6 @@ class Connection(ConnectionBase): if self._play_context.verbosity > 3: self._command += ['-vvv'] - elif binary == self._play_context.ssh_executable: - # Older versions of ssh (e.g. in RHEL 6) don't accept sftp -q. - self._command += ['-q'] # Next, we add [ssh_connection]ssh_args from ansible.cfg. @@ -611,7 +608,7 @@ class Connection(ConnectionBase): if return_tuple[0] != 255: break else: - raise AnsibleConnectionFailure("Failed to connect to the host via ssh.") + raise AnsibleConnectionFailure("Failed to connect to the host via ssh: %s" % to_native(return_tuple[2])) except (AnsibleConnectionFailure, Exception) as e: if attempt == remaining_tries - 1: raise