Template the run_once value in the linear strategy as we use it there
This is pre-post_validation, so we have to template it on the fly as we use it to determine if we bypass the host loop. Fixes #11876
This commit is contained in:
parent
365c5b23ce
commit
627dec716b
1 changed files with 3 additions and 3 deletions
|
@ -194,8 +194,6 @@ class StrategyModule(StrategyBase):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
action = action_loader.get(task.action, class_only=True)
|
action = action_loader.get(task.action, class_only=True)
|
||||||
if task.run_once or getattr(action, 'BYPASS_HOST_LOOP', False):
|
|
||||||
run_once = True
|
|
||||||
except KeyError:
|
except KeyError:
|
||||||
# we don't care here, because the action may simply not have a
|
# we don't care here, because the action may simply not have a
|
||||||
# corresponding action plugin
|
# corresponding action plugin
|
||||||
|
@ -227,6 +225,8 @@ class StrategyModule(StrategyBase):
|
||||||
templar = Templar(loader=self._loader, variables=task_vars)
|
templar = Templar(loader=self._loader, variables=task_vars)
|
||||||
display.debug("done getting variables")
|
display.debug("done getting variables")
|
||||||
|
|
||||||
|
run_once = templar.template(task.run_once)
|
||||||
|
|
||||||
if not callback_sent:
|
if not callback_sent:
|
||||||
display.debug("sending task start callback, copying the task so we can template it temporarily")
|
display.debug("sending task start callback, copying the task so we can template it temporarily")
|
||||||
saved_name = task.name
|
saved_name = task.name
|
||||||
|
@ -249,7 +249,7 @@ class StrategyModule(StrategyBase):
|
||||||
self._queue_task(host, task, task_vars, play_context)
|
self._queue_task(host, task, task_vars, play_context)
|
||||||
|
|
||||||
# if we're bypassing the host loop, break out now
|
# if we're bypassing the host loop, break out now
|
||||||
if run_once:
|
if run_once or getattr(action, 'BYPASS_HOST_LOOP', False):
|
||||||
break
|
break
|
||||||
|
|
||||||
results += self._process_pending_results(iterator, one_pass=True)
|
results += self._process_pending_results(iterator, one_pass=True)
|
||||||
|
|
Loading…
Reference in a new issue