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
pull/47826/head
Matt Martz 6 years ago committed by GitHub
parent 7db63851e0
commit fd662c0a63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save