Debian Codegraph @

test/integration/targets/gather_facts-errors/test_gather_facts.yml

raw
1 - hosts: localhost
2 gather_facts: no
3 vars:
4 ansible_facts_modules: [ fail1, success1, fail2 ]
5 tasks:
6 - name: Gather parallel and serially
7 gather_facts:
8 parallel: '{{ item }}'
9 ignore_errors: true
10 register: result
11 loop: [true, false]
12
13 - assert:
14 that:
15 - result.results | length == 2
16 - result.results[item] is failed
17 - result.results[item].exception is match "(?s)Traceback .* The following modules failed to execute"
18 - result.results[item].failed_modules | length == 2
19 - result.results[item].failed_modules.fail1.exception is match "(?s)Traceback .*the fail1 module went bang"
20 - result.results[item].failed_modules.fail2.exception is match "(?s)Traceback .*the fail2 module went bang"
21 loop:
22 - 0
23 - 1