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

Re-implement awx_display to not require being the stdout callback plugin #1322

Open
sivel opened this issue Oct 18, 2023 · 3 comments
Open

Comments

@sivel
Copy link
Member

sivel commented Oct 18, 2023

Ultimately making awx_display be the stdout callback plugin is rather limiting, and has complex implementation impacts to allow any non-default callback plugin to be specified by the user.

It would be more flexible if we can not require this, and allow awx_display to be an add on callback.

There are some things in core that likely need to change to permit this. A few potential options:

  1. Add a new callback type, specifically at this point for runner, that is also "singular" like stdout, that integrators can overwrite.
  2. Add the ability to prepend, append, etc to already configured options instead of overwriting: Ability to append a path to a setting's path list ansible#76519

We'll need to research the full capabilities needed of moving this plugin away from being the stdout plugin.

In addition to this:

  1. Stop the plugin from directly writing to stdout/stderr, and use core methods for doing this instead
  2. Research if there is a better implementation to be had instead of the "display steganography", see also Fix event correlation code in awx_display callback #1321
@github-actions github-actions bot added the needs_triage New item that needs to be triaged label Oct 18, 2023
@sivel sivel removed the needs_triage New item that needs to be triaged label Mar 12, 2024
@bcoca
Copy link
Member

bcoca commented May 23, 2024

So for (1 i would say just use the 'logging' type, which is not singular, but also I do not think it is required to be, it just needs to capture and make available the data required by the implementer in ways it hooks up to the code waiting for it.

For (2, we can call ansible-config to get the currently configured callbacks, add the desired plugin to the list and return it in ANSIBLE_CALLBACKS_ENABLED.

ansible-config dump |grep CALLBACKS_ENABLED

@mdebord-dlr
Copy link

Does this mean that currently if we change the default stdout callback from awx_display in ansible-runner, there are consequences/negative implications of doing so? I am currently working on a project at my org to use a custom stdout plugin with runner.

@Vel0X
Copy link

Vel0X commented Sep 23, 2024

Does this mean that currently if we change the default stdout callback from awx_display in ansible-runner, there are consequences/negative implications of doing so? I am currently working on a project at my org to use a custom stdout plugin with runner.

I am currently trying to add environemtal vars like "awx_job_id" via custom callback plugin to the json log I receive in logstash. I am not able to make it work. Did you do something similar and made it work? I was wondering if the issue is the execution environment with the awx_display.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants