summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/templating_lookups/template_lookups/tasks/errors.yml
blob: da57631a8d16de70d3a02c5d462e62b8ddbe5db9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
- name: Task that fails due to templating error for plugin option
  debug: msg="{{ 5 / 0 | int }}"
  ignore_errors: true
  register: result

- assert:
    that:
      - result.failed
      - result.exception

- name: Loop that fails due to templating error in first entry and ignores errors
  debug: msg="{{ 5 / item }}"
  ignore_errors: true
  register: result
  loop: [0, 0, 1]

- debug: var=result

- assert:
    that:
      - result.results[0].failed
      - result.results[0].exception
      - result.results[0].item == 0

      - result.results[1].failed
      - result.results[1].exception
      - result.results[1].item == 0

      - not result.results[2].failed
      - result.results[2].exception is undefined
      - result.results[2].item == 1