New parameter for template method.

We do not compute hash when we know that the result does not need to be cached (like with_items loop).
It also result in a small speed improvement.
This commit is contained in:
Yannig Perré 2015-11-09 22:30:32 +01:00
parent e36b4e2a13
commit 0c360d17cb
2 changed files with 9 additions and 8 deletions

View file

@ -256,7 +256,7 @@ class TaskExecutor:
variables['item'] = item
if self._task.evaluate_conditional(templar, variables):
if templar._contains_vars(name):
new_item = templar.template(name)
new_item = templar.template(name, cache=False)
final_items.append(new_item)
else:
final_items.append(item)