mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-03-08 02:25:20 +01:00
Display tasks times after a task completes, rather than at the beginning of the next task
This commit is contained in:
parent
f6fa00bfff
commit
24f6a44a0c
1 changed files with 24 additions and 1 deletions
|
|
@ -9,6 +9,8 @@
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
from ansible import constants as C
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = '''
|
||||||
callback: profile_tasks
|
callback: profile_tasks
|
||||||
type: aggregate
|
type: aggregate
|
||||||
|
|
@ -147,7 +149,6 @@ class CallbackModule(CallbackBase):
|
||||||
"""
|
"""
|
||||||
Logs the start of each task
|
Logs the start of each task
|
||||||
"""
|
"""
|
||||||
self._display.display(tasktime())
|
|
||||||
timestamp(self)
|
timestamp(self)
|
||||||
|
|
||||||
# Record the start time of the current task
|
# Record the start time of the current task
|
||||||
|
|
@ -156,6 +157,28 @@ class CallbackModule(CallbackBase):
|
||||||
if self._display.verbosity >= 2:
|
if self._display.verbosity >= 2:
|
||||||
self.stats[self.current]['path'] = task.get_path()
|
self.stats[self.current]['path'] = task.get_path()
|
||||||
|
|
||||||
|
def v2_runner_on_failed(self, result, ignore_errors=False):
|
||||||
|
self._display.display(tasktime())
|
||||||
|
|
||||||
|
def v2_runner_on_ok(self, result):
|
||||||
|
self._display.display(tasktime())
|
||||||
|
|
||||||
|
def v2_runner_on_skipped(self, result):
|
||||||
|
if C.DISPLAY_SKIPPED_HOSTS:
|
||||||
|
self._display.display(tasktime())
|
||||||
|
|
||||||
|
def v2_runner_on_unreachable(self, result):
|
||||||
|
self._display.display(tasktime())
|
||||||
|
|
||||||
|
def v2_runner_on_async_poll(self, result):
|
||||||
|
self._display.display(tasktime())
|
||||||
|
|
||||||
|
def v2_runner_on_async_ok(self, result):
|
||||||
|
self._display.display(tasktime())
|
||||||
|
|
||||||
|
def v2_runner_on_async_failed(self, result):
|
||||||
|
self._display.display(tasktime())
|
||||||
|
|
||||||
def v2_playbook_on_task_start(self, task, is_conditional):
|
def v2_playbook_on_task_start(self, task, is_conditional):
|
||||||
self._record_task(task)
|
self._record_task(task)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue