mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #3684 from stoned/fix-3668
Add extra module path early during playbook parsing.
This commit is contained in:
commit
daf5ecc7c9
2 changed files with 5 additions and 1 deletions
|
@ -132,6 +132,9 @@ class PlayBook(object):
|
||||||
else:
|
else:
|
||||||
self.inventory = inventory
|
self.inventory = inventory
|
||||||
|
|
||||||
|
if self.module_path is not None:
|
||||||
|
utils.plugins.module_finder.add_directory(self.module_path)
|
||||||
|
|
||||||
self.basedir = os.path.dirname(playbook) or '.'
|
self.basedir = os.path.dirname(playbook) or '.'
|
||||||
utils.plugins.push_basedir(self.basedir)
|
utils.plugins.push_basedir(self.basedir)
|
||||||
vars = extra_vars.copy()
|
vars = extra_vars.copy()
|
||||||
|
|
|
@ -132,6 +132,7 @@ class PluginLoader(object):
|
||||||
if directory is not None:
|
if directory is not None:
|
||||||
if with_subdir:
|
if with_subdir:
|
||||||
directory = os.path.join(directory, self.subdir)
|
directory = os.path.join(directory, self.subdir)
|
||||||
|
if directory not in self._extra_dirs:
|
||||||
self._extra_dirs.append(directory)
|
self._extra_dirs.append(directory)
|
||||||
|
|
||||||
def find_plugin(self, name):
|
def find_plugin(self, name):
|
||||||
|
|
Loading…
Reference in a new issue