1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

add ssh error message to failure

This commit is contained in:
Brian Coca 2016-09-29 17:19:17 -04:00 committed by Brian Coca
parent e4ee9de3f4
commit 24e81ddd1c

View file

@ -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