Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alter awx_display - add more information about tasks to event_data #1227

Open
urbanchef opened this issue Mar 27, 2023 · 1 comment
Open
Labels
needs_triage New item that needs to be triaged

Comments

@urbanchef
Copy link

urbanchef commented Mar 27, 2023

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:

task_ctx = dict(
task=(task.name or task.action),
task_uuid=str(task._uuid),
task_action=task.action,
resolved_action=getattr(task, 'resolved_action', task.action),
task_args='',
)

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?

@NaincyKumariKnoldus
Copy link

Hi, @urbanchef I raised the PR that you wanted. If any changes are still required please do let me know.
Please review it.
Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs_triage New item that needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants