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

Update source for reporting module_name #78

Merged
merged 1 commit into from
Sep 16, 2024
Merged

Conversation

alopezz
Copy link
Contributor

@alopezz alopezz commented Aug 23, 2024

Ref: AGENT-11915

Return values from tasks haven't included a module_name field under invocation for probably a long time (this is not well documented by Ansible). This has caused the module tag key to always contain the value undefined. This seems to be the current reference on what the results dictionary is expected to contain.

Even though I can't tell when this happened, I did find two references to this problem for an existing plugin:

I've based this fix on that PR, since Ansible documentation on what the objects passed to callbacks is rather sparse, and confirmed it to work. This has required to update existing callbacks to v2_ callbacks (and I can't see any drawbacks for that), for which I've used https://github.com/ansible/ansible/blob/b5e0293645570f3f404ad1dbbe5f006956ada0df/lib/ansible/plugins/callback/__init__.py#L526-L527 and the like as a reference of how one converts to the other.

I've also updated the module_stdout / module_stderr references to stdout / stderr following existing docs and my own observation during manual testing.

@alopezz alopezz requested a review from a team as a code owner August 23, 2024 08:29
@illogik
Copy link

illogik commented Sep 12, 2024

FWIW I've rolled this out in our environment and everything is working as expected now. Thank you for taking this on @alopezz !

@alopezz
Copy link
Contributor Author

alopezz commented Sep 13, 2024

FWIW I've rolled this out in our environment and everything is working as expected now. Thank you for taking this on @alopezz !

Thanks for circling back to report! I'll get this reviewed and merged to master ASAP.

@alopezz alopezz merged commit 31c5654 into master Sep 16, 2024
3 checks passed
@alopezz alopezz deleted the alopez/fix-module-name branch September 16, 2024 18:55
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

Successfully merging this pull request may close these issues.

3 participants