debug: hide loop variables while using var (#84597)

Fixes: #65856

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
pull/84611/head
Abhijeet Kasurde 1 year ago committed by GitHub
parent 03d6209862
commit e6adddcaf8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,3 @@
---
bugfixes:
- debug - hide loop vars in debug var display (https://github.com/ansible/ansible/issues/65856).

@ -163,7 +163,10 @@ class CallbackBase(AnsiblePlugin):
if options is not None:
self.set_options(options)
self._hide_in_debug = ('changed', 'failed', 'skipped', 'invocation', 'skip_reason')
self._hide_in_debug = (
'changed', 'failed', 'skipped', 'invocation', 'skip_reason',
'ansible_loop_var', 'ansible_index_var', 'ansible_loop',
)
# helper for callbacks, so they don't all have to include deepcopy
_copy_result = deepcopy

@ -120,7 +120,6 @@ failed: [testhost] (item=debug-2) =>
ok: [testhost] => (item=debug-3) =>
msg: debug-3
skipping: [testhost] => (item=debug-4) =>
ansible_loop_var: item
false_condition: item != 4
item: 4
fatal: [testhost]: FAILED! =>
@ -200,11 +199,9 @@ skipping: [testhost] =>
TASK [debug] *******************************************************************
skipping: [testhost] => (item=1) =>
ansible_loop_var: item
false_condition: false
item: 1
skipping: [testhost] => (item=2) =>
ansible_loop_var: item
false_condition: false
item: 2
skipping: [testhost] =>

@ -126,7 +126,6 @@ failed: [testhost] (item=debug-2) =>
ok: [testhost] => (item=debug-3) =>
msg: debug-3
skipping: [testhost] => (item=debug-4) =>
ansible_loop_var: item
false_condition: item != 4
item: 4
fatal: [testhost]: FAILED! =>
@ -207,11 +206,9 @@ skipping: [testhost] =>
TASK [debug] *******************************************************************
skipping: [testhost] => (item=1) =>
ansible_loop_var: item
false_condition: false
item: 1
skipping: [testhost] => (item=2) =>
ansible_loop_var: item
false_condition: false
item: 2
skipping: [testhost] =>

Loading…
Cancel
Save