mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Make less template calls on playbook objects.
This commit is contained in:
parent
728d81bf12
commit
0944e7d56a
1 changed files with 7 additions and 4 deletions
|
@ -65,10 +65,13 @@ class Play(object):
|
||||||
|
|
||||||
self._update_vars_files_for_host(None)
|
self._update_vars_files_for_host(None)
|
||||||
|
|
||||||
for key in ds:
|
# template everything to be efficient, but do not pre-mature template
|
||||||
if key != 'tasks' and key != 'handlers':
|
# tasks/handlers as they may have inventory scope overrides
|
||||||
# we want to template these later to allow inventory-scope a chance to override
|
_tasks = ds.pop('tasks', [])
|
||||||
ds[key] = template.template(basedir, ds[key], self.vars)
|
_handlers = ds.pop('handlers', [])
|
||||||
|
ds = template.template(basedir, ds, self.vars)
|
||||||
|
ds['tasks'] = _tasks
|
||||||
|
ds['handlers'] = _handlers
|
||||||
|
|
||||||
self._ds = ds
|
self._ds = ds
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue