Debian Codegraph @

test/integration/targets/tasks/playbook.yml

raw
1 - hosts: localhost
2 gather_facts: false
3 tasks:
4 # make sure tasks with an undefined variable in the name are gracefully handled
5 - name: "Task name with undefined variable: {{ not_defined }}"
6 debug:
7 msg: Hello
8
9 # ensure we properly test for an action name, not a task name when checking for a meta task
10 - name: "meta"
11 debug:
12 msg: Hello
13
14 - name: ensure malformed raw_params on arbitrary actions are not ignored
15 debug:
16 garbage {{"with a template"}}
17 ignore_errors: true
18 register: bad_templated_raw_param
19
20 - assert:
21 that:
22 - bad_templated_raw_param is failed
23 - bad_templated_raw_param.msg is contains("does not support raw params")
24
25 - name: validate error handling for actions that directly raise exceptions
26 action_that_fails:
27 fail_mode: raise
28 ignore_errors: true
29 register: action_with_raise
30
31 - assert:
32 that:
33 - action_with_raise is failed
34 - action_with_raise.msg is match "Task failed. I am an exception from an action"
35
36 - name: validate error handling for actions that directly set `exception` in result dict
37 action_that_fails:
38 fail_mode: result_dict
39 ignore_errors: true
40 register: action_with_result_fail
41
42 - assert:
43 that:
44 - action_with_result_fail is failed
45 - action_with_result_fail.msg is match "sorry, it broke"