mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Minor tweak to potentially speed the linear strategy up
* Don't fetch vars for the task unless we're going to use them
This commit is contained in:
parent
f17bdc4d61
commit
97954ff658
1 changed files with 5 additions and 5 deletions
|
@ -165,11 +165,6 @@ class StrategyModule(StrategyBase):
|
|||
# corresponding action plugin
|
||||
pass
|
||||
|
||||
debug("getting variables")
|
||||
task_vars = self._variable_manager.get_vars(loader=self._loader, play=iterator._play, host=host, task=task)
|
||||
templar = Templar(loader=self._loader, variables=task_vars)
|
||||
debug("done getting variables")
|
||||
|
||||
# check to see if this task should be skipped, due to it being a member of a
|
||||
# role which has already run (and whether that role allows duplicate execution)
|
||||
if task._role and task._role.has_run():
|
||||
|
@ -191,6 +186,11 @@ class StrategyModule(StrategyBase):
|
|||
else:
|
||||
raise AnsibleError("invalid meta action requested: %s" % meta_action, obj=task._ds)
|
||||
else:
|
||||
debug("getting variables")
|
||||
task_vars = self._variable_manager.get_vars(loader=self._loader, play=iterator._play, host=host, task=task)
|
||||
templar = Templar(loader=self._loader, variables=task_vars)
|
||||
debug("done getting variables")
|
||||
|
||||
if not callback_sent:
|
||||
temp_task = task.copy()
|
||||
temp_task.name = templar.template(temp_task.get_name(), fail_on_undefined=False)
|
||||
|
|
Loading…
Reference in a new issue