mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Handle run_once scenarios in the free strategy
* Raise an error if the action is using BYPASS_HOST_LOOP, to prevent unexpected behavior from those actions * Show a warning regarding tasks marked as run_once, as the free strategy does not yet support that behavior * Minor tweak to linear strategies run_once code to make sure we don't raise an error if an action isn't found
This commit is contained in:
@@ -199,7 +199,7 @@ class StrategyModule(StrategyBase):
|
||||
except KeyError:
|
||||
# we don't care here, because the action may simply not have a
|
||||
# corresponding action plugin
|
||||
pass
|
||||
action = None
|
||||
|
||||
# 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)
|
||||
@@ -227,7 +227,7 @@ class StrategyModule(StrategyBase):
|
||||
templar = Templar(loader=self._loader, variables=task_vars)
|
||||
display.debug("done getting variables")
|
||||
|
||||
run_once = templar.template(task.run_once) or getattr(action, 'BYPASS_HOST_LOOP', False)
|
||||
run_once = templar.template(task.run_once) or action and getattr(action, 'BYPASS_HOST_LOOP', False)
|
||||
|
||||
if task.any_errors_fatal or run_once:
|
||||
any_errors_fatal = True
|
||||
|
||||
Reference in New Issue
Block a user