Debian Codegraph @

test/integration/targets/module_utils/module_utils_vvvvv.yml

raw
1 - hosts: testhost
2 gather_facts: no
3 tasks:
4 - name: Use a specially crafted module to see if things were imported correctly
5 test:
6
7 # Invocation usually is output with 3vs or more, our callback plugin displays it anyway
8 - name: Check no_log invocation results
9 shell: ANSIBLE_INJECT_INVOCATION=1 ansible-playbook -i {{ inventory_file }} module_utils_test_no_log.yml
10 delegate_to: localhost
11 environment:
12 ANSIBLE_CALLBACK_PLUGINS: callback
13 ANSIBLE_STDOUT_CALLBACK: pure_json
14 register: no_log_invocation
15
16 - set_fact:
17 no_log_invocation: '{{ no_log_invocation.stdout | trim | from_json }}'
18
19 - name: check no log values from fallback or default are masked
20 assert:
21 that:
22 - no_log_invocation.invocation.module_args.default_pass == '$REDACTED$'
23 - no_log_invocation.invocation.module_args.explicit_pass == '$REDACTED$'
24 - no_log_invocation.invocation.module_args.fallback_pass == '$REDACTED$'
25 - no_log_invocation.invocation.module_args.normal == 'plaintext'
26 - no_log_invocation.invocation.module_args.suboption.default_sub_pass == '$REDACTED$'
27 - no_log_invocation.invocation.module_args.suboption.explicit_sub_pass == '$REDACTED$'
28 - no_log_invocation.invocation.module_args.suboption.fallback_sub_pass == '$REDACTED$'
29 - no_log_invocation.invocation.module_args.suboption.normal == 'plaintext'