mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge branch 'issue4022' of https://github.com/sfromm/ansible into sfromm-issue4022
Conflicts: lib/ansible/runner/connection_plugins/accelerate.py
This commit is contained in:
commit
3848e02959
2 changed files with 20 additions and 8 deletions
|
@ -180,6 +180,7 @@ class Runner(object):
|
||||||
self.accelerate = accelerate
|
self.accelerate = accelerate
|
||||||
self.accelerate_port = accelerate_port
|
self.accelerate_port = accelerate_port
|
||||||
self.callbacks.runner = self
|
self.callbacks.runner = self
|
||||||
|
self.original_transport = self.transport
|
||||||
|
|
||||||
if self.transport == 'smart':
|
if self.transport == 'smart':
|
||||||
# if the transport is 'smart' see if SSH can support ControlPersist if not use paramiko
|
# if the transport is 'smart' see if SSH can support ControlPersist if not use paramiko
|
||||||
|
|
|
@ -23,6 +23,7 @@ import struct
|
||||||
import time
|
import time
|
||||||
from ansible.callbacks import vvv
|
from ansible.callbacks import vvv
|
||||||
from ansible.runner.connection_plugins.ssh import Connection as SSHConnection
|
from ansible.runner.connection_plugins.ssh import Connection as SSHConnection
|
||||||
|
from ansible.runner.connection_plugins.paramiko_ssh import Connection as ParamikoConnection
|
||||||
from ansible import utils
|
from ansible import utils
|
||||||
from ansible import errors
|
from ansible import errors
|
||||||
from ansible import constants
|
from ansible import constants
|
||||||
|
@ -59,14 +60,24 @@ class Connection(object):
|
||||||
elif not isinstance(self.accport, int):
|
elif not isinstance(self.accport, int):
|
||||||
self.accport = int(self.accport)
|
self.accport = int(self.accport)
|
||||||
|
|
||||||
self.ssh = SSHConnection(
|
if self.runner.original_transport == "paramiko":
|
||||||
runner=self.runner,
|
self.ssh = ParamikoConnection(
|
||||||
host=self.host,
|
runner=self.runner,
|
||||||
port=self.port,
|
host=self.host,
|
||||||
user=self.user,
|
port=self.port,
|
||||||
password=password,
|
user=self.user,
|
||||||
private_key_file=private_key_file
|
password=password,
|
||||||
)
|
private_key_file=private_key_file
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
self.ssh = SSHConnection(
|
||||||
|
runner=self.runner,
|
||||||
|
host=self.host,
|
||||||
|
port=self.port,
|
||||||
|
user=self.user,
|
||||||
|
password=password,
|
||||||
|
private_key_file=private_key_file
|
||||||
|
)
|
||||||
|
|
||||||
# attempt to work around shared-memory funness
|
# attempt to work around shared-memory funness
|
||||||
if getattr(self.runner, 'aes_keys', None):
|
if getattr(self.runner, 'aes_keys', None):
|
||||||
|
|
Loading…
Reference in a new issue