mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-04 15:34:01 -07:00
When using delegation, local_action should always use the local connection type.
This commit is contained in:
parent
d58bc4da4e
commit
31b45479e8
3 changed files with 12 additions and 8 deletions
|
@ -40,12 +40,13 @@ class Connection(object):
|
|||
self.runner = runner
|
||||
self.modules = None
|
||||
|
||||
def connect(self, host, port):
|
||||
def connect(self, host, port, transport=None):
|
||||
if self.modules is None:
|
||||
self.modules = modules.copy()
|
||||
self.modules.update(utils.import_plugins(os.path.join(self.runner.basedir, 'connection_plugins')))
|
||||
conn = None
|
||||
transport = self.runner.transport
|
||||
if transport is None:
|
||||
transport = self.runner.transport
|
||||
module = self.modules.get(transport, None)
|
||||
if module is None:
|
||||
raise AnsibleError("unsupported connection type: %s" % transport)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue