mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
ssh_alt - only trigger 'fatal' when returncode == 255 (interpreted as 'could no connect')
This commit is contained in:
@@ -272,7 +272,7 @@ class Connection(object):
|
|||||||
controlpersisterror = stderr.find('Bad configuration option: ControlPersist') != -1 or stderr.find('unknown configuration option: ControlPersist') != -1
|
controlpersisterror = stderr.find('Bad configuration option: ControlPersist') != -1 or stderr.find('unknown configuration option: ControlPersist') != -1
|
||||||
if p.returncode != 0 and controlpersisterror:
|
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')
|
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')
|
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)
|
return (p.returncode, '', stdout, stderr)
|
||||||
|
|||||||
Reference in New Issue
Block a user