Debian Codegraph @

test/integration/targets/json_cleanup/module_output_cleaning.yml

raw
1 - name: ensure we clean module output well
2 hosts: localhost
3 gather_facts: false
4 tasks:
5 - name: where is bash
6 shell: command -v bash
7 register: bash
8 changed_when: false
9
10 - name: call module that spews extra stuff
11 bad_json:
12 register: clean_json
13 ignore_errors: true
14 vars:
15 ansible_bash_interpreter: '{{ bash.stdout }}'
16
17 - name: all expected is there
18 assert:
19 that:
20 - clean_json is success
21 - clean_json is not changed
22 - "clean_json['msg'] == 'good json response'"
23
24 - name: all non wanted is not there
25 assert:
26 that:
27 - item not in clean_json.values()
28 loop:
29 - this stuff should be ignored
30 - [ looks like a json list]
31 - '[ looks like a json list]'
32 - ' looks like a json list'
33 - moar garbage