mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Added support for -vvvv to enable ssh connection debugging
This patch also checks specifically for a return code of 255, which indicates an unknown SSH error of some kind. When that happens, ansible will now recommend running with -vvvv (if not enabled) or show the output from 'ssh -vvv' (when it is enabled)
This commit is contained in:
@@ -776,6 +776,11 @@ class Runner(object):
|
||||
if result['rc'] != 0:
|
||||
if result['rc'] == 5:
|
||||
output = 'Authentication failure.'
|
||||
elif result['rc'] == 255:
|
||||
if utils.VERBOSITY > 3:
|
||||
output = 'SSH encountered an unknown error. The output was:\n%s' % (result['stdout']+result['stderr'])
|
||||
else:
|
||||
output = 'SSH encountered an unknown error during the connection. We recommend you re-run the command using -vvvv, which will enable SSH debugging output to help diagnose the issue'
|
||||
else:
|
||||
output = 'Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in "/tmp". Failed command was: %s, exited with result %d' % (cmd, result['rc'])
|
||||
if 'stdout' in result and result['stdout'] != '':
|
||||
|
||||
Reference in New Issue
Block a user