mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
Make --module-path work and expand tilde's in paths
Fixes #9937 Fixes #9949
This commit is contained in:
parent
fffb65d45f
commit
dcb9b5a69f
2 changed files with 16 additions and 4 deletions
|
@ -25,6 +25,7 @@ from ansible import constants as C
|
|||
from ansible.errors import *
|
||||
from ansible.executor.task_queue_manager import TaskQueueManager
|
||||
from ansible.playbook import Playbook
|
||||
from ansible.plugins import module_loader
|
||||
from ansible.template import Templar
|
||||
|
||||
from ansible.utils.color import colorize, hostcolor
|
||||
|
@ -46,6 +47,12 @@ class PlaybookExecutor:
|
|||
self._options = options
|
||||
self.passwords = passwords
|
||||
|
||||
# make sure the module path (if specified) is parsed and
|
||||
# added to the module_loader object
|
||||
if options.module_path is not None:
|
||||
for path in options.module_path.split(os.pathsep):
|
||||
module_loader.add_directory(path)
|
||||
|
||||
if options.listhosts or options.listtasks or options.listtags or options.syntax:
|
||||
self._tqm = None
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue