Jordan Borean 2 weeks ago committed by GitHub
commit 5f4a200f87
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,4 @@
minor_changes:
- >-
Include the explicit import_tasks and import_role tasks in the play iterator for the strategy to see. By default
these tasks are skipped but a strategy can utilise them in a special way if needed.

@ -241,6 +241,9 @@ def load_list_of_tasks(ds, play, block=None, role=None, task_include=None, use_h
variable_manager=variable_manager,
)
if not use_handlers:
task_list.append(ti_copy)
tags = ti_copy.tags[:]
# now we extend the tags on each of the included blocks
@ -284,6 +287,9 @@ def load_list_of_tasks(ds, play, block=None, role=None, task_include=None, use_h
ir.post_validate(templar=templar)
ir._role_name = templar.template(ir._role_name)
if not use_handlers:
task_list.append(ir)
# uses compiled list from object
blocks, dummy = ir.get_block_list(variable_manager=variable_manager, loader=loader)
task_list.extend(blocks)

@ -352,6 +352,13 @@ class StrategyBase:
display.debug("entering _queue_task() for %s/%s" % (host.name, task.action))
# import_* tasks should be ignored as they are already handled when
# the play was loaded.
if task.action in C._ACTION_IMPORT_TASKS + C._ACTION_IMPORT_ROLE:
if host.name in self._blocked_hosts:
del self._blocked_hosts[host.name]
return
# Add a write lock for tasks.
# Maybe this should be added somewhere further up the call stack but
# this is the earliest in the code where we have task (1) extracted

@ -191,7 +191,7 @@ class StrategyModule(StrategyBase):
"as tasks are executed independently on each host")
if isinstance(task, Handler):
self._tqm.send_callback('v2_playbook_on_handler_task_start', task)
else:
elif action not in C._ACTION_IMPORT_TASKS + C._ACTION_IMPORT_ROLE:
self._tqm.send_callback('v2_playbook_on_task_start', task, is_conditional=False)
self._queue_task(host, task, task_vars, play_context)
# each task is counted as a worker being busy

@ -230,7 +230,7 @@ class StrategyModule(StrategyBase):
display.debug("here goes the callback...")
if isinstance(task, Handler):
self._tqm.send_callback('v2_playbook_on_handler_task_start', task)
else:
elif action not in C._ACTION_IMPORT_TASKS + C._ACTION_IMPORT_ROLE:
self._tqm.send_callback('v2_playbook_on_task_start', task, is_conditional=False)
task.name = saved_name
callback_sent = True

Loading…
Cancel
Save