mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-02 22:39:09 -07:00
faster config loading (#48333)
* faster config loading - used already loaded module var instead of doc functions - add preload to populate config defs cache - avoid debug work when not in debug - generators, force consumption
This commit is contained in:
parent
9d4c0dc111
commit
960388143f
3 changed files with 22 additions and 18 deletions
|
@ -27,6 +27,7 @@ from ansible.executor.task_queue_manager import TaskQueueManager
|
|||
from ansible.module_utils._text import to_native, to_text
|
||||
from ansible.playbook import Playbook
|
||||
from ansible.template import Templar
|
||||
from ansible.plugins.loader import connection_loader, shell_loader
|
||||
from ansible.utils.helpers import pct_to_int
|
||||
from ansible.module_utils.parsing.convert_bool import boolean
|
||||
from ansible.utils.path import makedirs_safe
|
||||
|
@ -76,6 +77,10 @@ class PlaybookExecutor:
|
|||
entrylist = []
|
||||
entry = {}
|
||||
try:
|
||||
# preload become/connecition/shell to set config defs cached
|
||||
list(connection_loader.all(class_only=True))
|
||||
list(shell_loader.all(class_only=True))
|
||||
|
||||
for playbook_path in self._playbooks:
|
||||
pb = Playbook.load(playbook_path, variable_manager=self._variable_manager, loader=self._loader)
|
||||
# FIXME: move out of inventory self._inventory.set_playbook_basedir(os.path.realpath(os.path.dirname(playbook_path)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue