mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 06:31:23 -07:00
Get v2_playbook_on_start working
* Move self._tqm.load_callbacks() earlier to ensure that v2_on_playbook_start can fire * Pass the playbook instance to v2_on_playbook_start * Add a _file_name instance attribute to the playbook
This commit is contained in:
parent
53cd802251
commit
384b2e0234
3 changed files with 8 additions and 3 deletions
|
@ -82,6 +82,10 @@ class PlaybookExecutor:
|
|||
if self._tqm is None: # we are doing a listing
|
||||
entry = {'playbook': playbook_path}
|
||||
entry['plays'] = []
|
||||
else:
|
||||
# make sure the tqm has callbacks loaded
|
||||
self._tqm.load_callbacks()
|
||||
self._tqm.send_callback('v2_playbook_on_start', pb)
|
||||
|
||||
i = 1
|
||||
plays = pb.get_plays()
|
||||
|
@ -130,8 +134,6 @@ class PlaybookExecutor:
|
|||
entry['plays'].append(new_play)
|
||||
|
||||
else:
|
||||
# make sure the tqm has callbacks loaded
|
||||
self._tqm.load_callbacks()
|
||||
self._tqm._unreachable_hosts.update(self._unreachable_hosts)
|
||||
|
||||
# we are actually running plays
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue