Set task_action when the action does not need to be templated

Fixes #13042
This commit is contained in:
Toshio Kuratomi 2015-11-05 08:37:39 -08:00
parent 9753de35a7
commit 4f6d4c6bf6

View file

@ -235,8 +235,9 @@ class TaskExecutor:
# that aren't available until later (it could even use vars from the # that aren't available until later (it could even use vars from the
# with_items loop) so don't make the templated string permanent yet. # with_items loop) so don't make the templated string permanent yet.
templar = Templar(loader=self._loader, shared_loader_obj=self._shared_loader_obj, variables=variables) templar = Templar(loader=self._loader, shared_loader_obj=self._shared_loader_obj, variables=variables)
if templar._contains_vars(self._task.action): task_action = self._task.action
task_action = templar.template(self._task.action, fail_on_undefined=False) if templar._contains_vars(task_action):
task_action = templar.template(task_action, fail_on_undefined=False)
if len(items) > 0 and task_action in self.SQUASH_ACTIONS: if len(items) > 0 and task_action in self.SQUASH_ACTIONS:
if all(isinstance(o, string_types) for o in items): if all(isinstance(o, string_types) for o in items):