ansible-runner
ansible-runner copied to clipboard
Alter awx_display - add more information about tasks to event_data
In my project I process event_data and form a custom report on tasks that has been executed, their status, etc..
I wonder how and if at all possible would be to add TaskResult._task.check_mode
or any other TaskResult's or task's properties to event_data in awx_display?
For example,
result = ansible_runner.run(....)
for e in result.events:
if e['event_data']['task_check_mode']:
print(e)
Task properties data is injected here: https://github.com/ansible/ansible-runner/blob/d467662f585f5bb6ed2c5e8d57f130772760031a/ansible_runner/display_callback/callback/awx_display.py#L408-L414
I would like it to be:
task_ctx = dict(
task=(task.name or task.action),
task_uuid=str(task._uuid),
task_action=task.action,
task_check_mode=task.check_mode,
resolved_action=getattr(task, 'resolved_action', task.action),
task_args='',
)
Would you consider accepting such a PR?
Hi, @urbanchef I raised the PR that you wanted. If any changes are still required please do let me know. Please review it. Thanks!!