1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-02-04 07:51:50 +00:00

[PR #10752/f6003f61 backport][stable-10] selective: don't hard code ansible_loop_var 'item' (#10763)

selective: don't hard code ansible_loop_var 'item' (#10752)

* selective: don't hard code ansible_loop_var 'item'

* Add changelog fragment

* Update changelog message



---------


(cherry picked from commit f6003f61cc)

Co-authored-by: Hoang Nguyen <folliekazetani@protonmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
patchback[bot] 2025-08-29 07:06:42 +02:00 committed by GitHub
parent 02fa9106c6
commit 6b59a3c1f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- selective callback plugin - specify ``ansible_loop_var`` instead of the explicit value ``item`` when printing task result (https://github.com/ansible-collections/community.general/pull/10752).

View file

@ -208,7 +208,7 @@ class CallbackModule(CallbackBase):
stderr = [r.get('exception', None), r.get('module_stderr', None)]
stderr = "\n".join([e for e in stderr if e]).strip()
self._print_host_or_item(r['item'],
self._print_host_or_item(r[r['ansible_loop_var']],
r.get('changed', False),
to_text(r.get('msg', '')),
r.get('diff', None),