ansible / ansible-runner

A tool and python library that helps when interfacing with Ansible directly or as part of another system whether that be through a container image interface, as a standalone tool, or as a Python module that can be imported. The goal is to provide a stable and consistent interface abstraction to Ansible.
Other
969 stars 357 forks source link

Added more information about tasks to event_data #1227 #1233

Open NaincyKumariKnoldus opened 1 year ago

NaincyKumariKnoldus commented 1 year ago

Hi!! I have updated /ansible_runner/display_callback/callback/awx_display.py. Added more information about tasks to event_data as you have mentioned.

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='', )

Please review this PR and merge it. If any changes still required please do let me know.

Thanks!

1227

nitzmahone commented 1 year ago

Given that most tasks aren't in check mode most of the time, maybe this key should only be added if the task is in check mode and callers can assume its absence as False. Otherwise this further bloats up the already quite-large event payloads with data that most people don't need.

Akasurde commented 1 year ago

@NaincyKumariKnoldus Thanks for the PR. Could you please address @nitzmahone's review and also add a test for this change? Thanks,