Debian Codegraph @

test/integration/targets/parsing/parsing.yml

raw
1 - hosts: testhost
2 gather_facts: no
3 tasks:
4 - name: test that a variable cannot inject raw arguments
5 shell: echo hi {{ chdir }}
6 vars:
7 chdir: mom chdir=/tmp
8 register: raw_injection
9
10 - name: test that a variable cannot inject kvp arguments as a kvp
11 file: path={{ test_file }} {{ test_input }}
12 vars:
13 test_file: "{{ output_dir }}/ansible_test_file"
14 test_input: "owner=test"
15 register: kvp_kvp_injection
16 ignore_errors: yes
17
18 - name: test that a variable cannot inject kvp arguments as a value
19 file: state=absent path='{{ kvp_in_var }}'
20 vars:
21 kvp_in_var: "{{ output_dir }}' owner='test"
22 register: kvp_value_injection
23
24 - name: test that a missing filter fails
25 debug:
26 msg: "{{ output_dir | badfiltername }}"
27 register: filter_missing
28 ignore_errors: yes
29
30 - assert:
31 that:
32 - raw_injection.stdout == 'hi mom chdir=/tmp'
33 - kvp_kvp_injection is failed
34 - kvp_value_injection.path.endswith("' owner='test")
35 - filter_missing is failed