New v2_runner_on_start callback added (#47684)
* New v2_runner_on_start callback added to indicate the start of execution for a host in a specific task * Add changelog fragment * Minor docstring clarification
This commit is contained in:
parent
7db63851e0
commit
fd662c0a63
3 changed files with 10 additions and 0 deletions
2
changelogs/fragments/host-start-callback.yaml
Normal file
2
changelogs/fragments/host-start-callback.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
minor_changes:
|
||||
- callbacks - New ``v2_runner_on_start`` callback added to indicate the start of execution for a host in a specific task (https://github.com/ansible/ansible/pull/47684)
|
|
@ -412,3 +412,10 @@ class CallbackBase(AnsiblePlugin):
|
|||
|
||||
def v2_runner_retry(self, result):
|
||||
pass
|
||||
|
||||
def v2_runner_on_start(self, host, task):
|
||||
"""Event used when host begins execution of a task
|
||||
|
||||
.. versionadded:: 2.8
|
||||
"""
|
||||
pass
|
||||
|
|
|
@ -317,6 +317,7 @@ class StrategyBase:
|
|||
|
||||
worker_prc = WorkerProcess(self._final_q, task_vars, host, task, play_context, self._loader, self._variable_manager, shared_loader_obj)
|
||||
self._workers[self._cur_worker] = worker_prc
|
||||
self._tqm.send_callback('v2_runner_on_start', host, task)
|
||||
worker_prc.start()
|
||||
display.debug("worker is %d (out of %d available)" % (self._cur_worker + 1, len(self._workers)))
|
||||
queued = True
|
||||
|
|
Loading…
Reference in a new issue