Merge pull request #13405 from sivel/v2-playbook-on-start
Get v2_playbook_on_start working
This commit is contained in:
commit
5f1f2acfea
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
|
if self._tqm is None: # we are doing a listing
|
||||||
entry = {'playbook': playbook_path}
|
entry = {'playbook': playbook_path}
|
||||||
entry['plays'] = []
|
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
|
i = 1
|
||||||
plays = pb.get_plays()
|
plays = pb.get_plays()
|
||||||
|
@ -130,8 +134,6 @@ class PlaybookExecutor:
|
||||||
entry['plays'].append(new_play)
|
entry['plays'].append(new_play)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# make sure the tqm has callbacks loaded
|
|
||||||
self._tqm.load_callbacks()
|
|
||||||
self._tqm._unreachable_hosts.update(self._unreachable_hosts)
|
self._tqm._unreachable_hosts.update(self._unreachable_hosts)
|
||||||
|
|
||||||
# we are actually running plays
|
# we are actually running plays
|
||||||
|
|
|
@ -44,6 +44,7 @@ class Playbook:
|
||||||
self._entries = []
|
self._entries = []
|
||||||
self._basedir = os.getcwd()
|
self._basedir = os.getcwd()
|
||||||
self._loader = loader
|
self._loader = loader
|
||||||
|
self._file_name = None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def load(file_name, variable_manager=None, loader=None):
|
def load(file_name, variable_manager=None, loader=None):
|
||||||
|
@ -61,6 +62,8 @@ class Playbook:
|
||||||
# set the loaders basedir
|
# set the loaders basedir
|
||||||
self._loader.set_basedir(self._basedir)
|
self._loader.set_basedir(self._basedir)
|
||||||
|
|
||||||
|
self._file_name = file_name
|
||||||
|
|
||||||
# dynamically load any plugins from the playbook directory
|
# dynamically load any plugins from the playbook directory
|
||||||
for name, obj in get_all_plugin_loaders():
|
for name, obj in get_all_plugin_loaders():
|
||||||
if obj.subdir:
|
if obj.subdir:
|
||||||
|
|
|
@ -246,7 +246,7 @@ class CallbackBase:
|
||||||
def v2_runner_on_file_diff(self, result, diff):
|
def v2_runner_on_file_diff(self, result, diff):
|
||||||
pass #no v1 correspondance
|
pass #no v1 correspondance
|
||||||
|
|
||||||
def v2_playbook_on_start(self):
|
def v2_playbook_on_start(self, playbook):
|
||||||
self.playbook_on_start()
|
self.playbook_on_start()
|
||||||
|
|
||||||
def v2_playbook_on_notify(self, result, handler):
|
def v2_playbook_on_notify(self, result, handler):
|
||||||
|
|
Loading…
Add table
Reference in a new issue