mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 20:31:27 -07:00
added playbook and options info to callbacks
will display on certain verbosity levels, both playbook/file info and non empty options with which it's running. avoid errors when not using CLI classes
This commit is contained in:
parent
0a4642fcc2
commit
6012646d8c
2 changed files with 23 additions and 0 deletions
|
@ -230,3 +230,16 @@ class CallbackModule(CallbackBase):
|
|||
|
||||
self._display.display("", screen_only=True)
|
||||
|
||||
def v2_playbook_on_start(self, playbook):
|
||||
if self._display.verbosity > 1:
|
||||
from os.path import basename
|
||||
self._display.banner("PLAYBOOK: %s" % basename(playbook._file_name))
|
||||
|
||||
if self._display.verbosity > 3:
|
||||
if self._options is not None:
|
||||
for option in dir(self._options):
|
||||
if option.startswith('_') or option in ['read_file', 'ensure_value', 'read_module']:
|
||||
continue
|
||||
val = getattr(self._options,option)
|
||||
if val:
|
||||
self._display.vvvv('%s: %s' % (option,val))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue