mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
add ssh error message to failure
This commit is contained in:
parent
e4ee9de3f4
commit
24e81ddd1c
1 changed files with 1 additions and 4 deletions
|
@ -148,9 +148,6 @@ class Connection(ConnectionBase):
|
||||||
|
|
||||||
if self._play_context.verbosity > 3:
|
if self._play_context.verbosity > 3:
|
||||||
self._command += ['-vvv']
|
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.
|
# Next, we add [ssh_connection]ssh_args from ansible.cfg.
|
||||||
|
|
||||||
|
@ -611,7 +608,7 @@ class Connection(ConnectionBase):
|
||||||
if return_tuple[0] != 255:
|
if return_tuple[0] != 255:
|
||||||
break
|
break
|
||||||
else:
|
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:
|
except (AnsibleConnectionFailure, Exception) as e:
|
||||||
if attempt == remaining_tries - 1:
|
if attempt == remaining_tries - 1:
|
||||||
raise
|
raise
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue