mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Treat 255 errors from raw as dark host
Any other module is able to detect a dark host, but raw was treating 255 as a return code from the module execution, rather from the connection attempt. This change allows 255 to be treated as a connection failure when using the raw module.
This commit is contained in:
parent
cf434df6a4
commit
3315ba0b99
1 changed files with 1 additions and 1 deletions
|
@ -343,7 +343,7 @@ class Connection(object):
|
||||||
|
|
||||||
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 == 255 and in_data:
|
if p.returncode == 255 and (in_data or self.runner.module_name == 'raw'):
|
||||||
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)
|
||||||
|
|
Loading…
Reference in a new issue