mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-11 07:05:27 +01:00
json[l] callback: add play/task path info
Add the play and task path info (i.e., filename and line number) to the JSON that is emitted from the json and jsonl callback plugins, allowing more accurate post-mortem analysis. Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
This commit is contained in:
parent
b6587a783e
commit
940d914904
3 changed files with 6 additions and 0 deletions
2
changelogs/fragments/440-json-add-path-field.yaml
Normal file
2
changelogs/fragments/440-json-add-path-field.yaml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
minor_changes:
|
||||
- json and jsonl - Add the ``path`` attribute into the play and task output
|
||||
|
|
@ -67,6 +67,7 @@ class CallbackModule(CallbackBase):
|
|||
'play': {
|
||||
'name': play.get_name(),
|
||||
'id': to_text(play._uuid),
|
||||
'path': to_text(play.get_path()),
|
||||
'duration': {
|
||||
'start': current_time()
|
||||
}
|
||||
|
|
@ -79,6 +80,7 @@ class CallbackModule(CallbackBase):
|
|||
'task': {
|
||||
'name': task.get_name(),
|
||||
'id': to_text(task._uuid),
|
||||
'path': to_text(task.get_path()),
|
||||
'duration': {
|
||||
'start': current_time()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ class CallbackModule(CallbackBase):
|
|||
'play': {
|
||||
'name': play.get_name(),
|
||||
'id': to_text(play._uuid),
|
||||
'path': to_text(play.get_path()),
|
||||
'duration': {
|
||||
'start': current_time()
|
||||
}
|
||||
|
|
@ -81,6 +82,7 @@ class CallbackModule(CallbackBase):
|
|||
'task': {
|
||||
'name': task.get_name(),
|
||||
'id': to_text(task._uuid),
|
||||
'path': to_text(task.get_path()),
|
||||
'duration': {
|
||||
'start': current_time()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue