mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Look for plugins in the playbook's basedir
This commit is contained in:
@@ -167,6 +167,11 @@ class Runner(object):
|
||||
for (k,v) in lookup_plugin_list.iteritems():
|
||||
self.lookup_plugins[k] = v.LookupModule(self)
|
||||
|
||||
for (k,v) in utils.import_plugins(os.path.join(self.basedir, 'action_plugins')).iteritems():
|
||||
self.action_plugins[k] = v.ActionModule(self)
|
||||
for (k,v) in utils.import_plugins(os.path.join(self.basedir, 'lookup_plugins')).iteritems():
|
||||
self.lookup_plugins[k] = v.LookupModule(self)
|
||||
|
||||
# *****************************************************
|
||||
|
||||
def _delete_remote_files(self, conn, files):
|
||||
|
||||
@@ -34,11 +34,15 @@ class Connection(object):
|
||||
|
||||
def __init__(self, runner):
|
||||
self.runner = runner
|
||||
self.modules = None
|
||||
|
||||
def connect(self, host, port):
|
||||
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
|
||||
module = modules.get(transport, None)
|
||||
module = self.modules.get(transport, None)
|
||||
if module is None:
|
||||
raise AnsibleError("unsupported connection type: %s" % transport)
|
||||
conn = module.Connection(self.runner, host, port)
|
||||
|
||||
Reference in New Issue
Block a user