Fall back to paramiko if the smart detection fails to run ssh
Fixes #11695
This commit is contained in:
parent
dfcf6a2016
commit
d412bc72ef
1 changed files with 6 additions and 3 deletions
|
@ -407,10 +407,13 @@ class TaskExecutor:
|
||||||
conn_type = "paramiko"
|
conn_type = "paramiko"
|
||||||
else:
|
else:
|
||||||
# see if SSH can support ControlPersist if not use paramiko
|
# see if SSH can support ControlPersist if not use paramiko
|
||||||
|
try:
|
||||||
cmd = subprocess.Popen(['ssh','-o','ControlPersist'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
cmd = subprocess.Popen(['ssh','-o','ControlPersist'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
(out, err) = cmd.communicate()
|
(out, err) = cmd.communicate()
|
||||||
if "Bad configuration option" in err:
|
if "Bad configuration option" in err:
|
||||||
conn_type = "paramiko"
|
conn_type = "paramiko"
|
||||||
|
except OSError:
|
||||||
|
conn_type = "paramiko"
|
||||||
|
|
||||||
connection = connection_loader.get(conn_type, self._play_context, self._new_stdin)
|
connection = connection_loader.get(conn_type, self._play_context, self._new_stdin)
|
||||||
if not connection:
|
if not connection:
|
||||||
|
|
Loading…
Reference in a new issue