mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-16 17:01:30 +00:00
Reformat everything.
This commit is contained in:
parent
3f2213791a
commit
340ff8586d
1008 changed files with 61301 additions and 58309 deletions
|
|
@ -49,9 +49,10 @@ class CallbackModule(CallbackBase):
|
|||
"""
|
||||
logs playbook results, per host, in /var/log/ansible/hosts
|
||||
"""
|
||||
|
||||
CALLBACK_VERSION = 2.0
|
||||
CALLBACK_TYPE = 'notification'
|
||||
CALLBACK_NAME = 'community.general.log_plays'
|
||||
CALLBACK_TYPE = "notification"
|
||||
CALLBACK_NAME = "community.general.log_plays"
|
||||
CALLBACK_NEEDS_WHITELIST = True
|
||||
|
||||
TIME_FORMAT = "%b %d %Y %H:%M:%S"
|
||||
|
|
@ -61,7 +62,6 @@ class CallbackModule(CallbackBase):
|
|||
return f"{now} - {playbook} - {task_name} - {task_action} - {category} - {data}\n\n"
|
||||
|
||||
def __init__(self):
|
||||
|
||||
super().__init__()
|
||||
|
||||
def set_options(self, task_keys=None, var_options=None, direct=None):
|
||||
|
|
@ -75,12 +75,12 @@ class CallbackModule(CallbackBase):
|
|||
def log(self, result, category):
|
||||
data = result._result
|
||||
if isinstance(data, MutableMapping):
|
||||
if '_ansible_verbose_override' in data:
|
||||
if "_ansible_verbose_override" in data:
|
||||
# avoid logging extraneous data
|
||||
data = 'omitted'
|
||||
data = "omitted"
|
||||
else:
|
||||
data = data.copy()
|
||||
invocation = data.pop('invocation', None)
|
||||
invocation = data.pop("invocation", None)
|
||||
data = json.dumps(data, cls=AnsibleJSONEncoder)
|
||||
if invocation is not None:
|
||||
data = f"{json.dumps(invocation)} => {data} "
|
||||
|
|
@ -93,25 +93,25 @@ class CallbackModule(CallbackBase):
|
|||
fd.write(msg)
|
||||
|
||||
def v2_runner_on_failed(self, result, ignore_errors=False):
|
||||
self.log(result, 'FAILED')
|
||||
self.log(result, "FAILED")
|
||||
|
||||
def v2_runner_on_ok(self, result):
|
||||
self.log(result, 'OK')
|
||||
self.log(result, "OK")
|
||||
|
||||
def v2_runner_on_skipped(self, result):
|
||||
self.log(result, 'SKIPPED')
|
||||
self.log(result, "SKIPPED")
|
||||
|
||||
def v2_runner_on_unreachable(self, result):
|
||||
self.log(result, 'UNREACHABLE')
|
||||
self.log(result, "UNREACHABLE")
|
||||
|
||||
def v2_runner_on_async_failed(self, result):
|
||||
self.log(result, 'ASYNC_FAILED')
|
||||
self.log(result, "ASYNC_FAILED")
|
||||
|
||||
def v2_playbook_on_start(self, playbook):
|
||||
self.playbook = playbook._file_name
|
||||
|
||||
def v2_playbook_on_import_for_host(self, result, imported_file):
|
||||
self.log(result, 'IMPORTED', imported_file)
|
||||
self.log(result, "IMPORTED", imported_file)
|
||||
|
||||
def v2_playbook_on_not_import_for_host(self, result, missing_file):
|
||||
self.log(result, 'NOTIMPORTED', missing_file)
|
||||
self.log(result, "NOTIMPORTED", missing_file)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue