summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/templating_lookups/template_lookups/tasks/errors.yml
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/templating_lookups/template_lookups/tasks/errors.yml')
-rw-r--r--test/integration/targets/templating_lookups/template_lookups/tasks/errors.yml31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/integration/targets/templating_lookups/template_lookups/tasks/errors.yml b/test/integration/targets/templating_lookups/template_lookups/tasks/errors.yml
new file mode 100644
index 0000000..da57631
--- /dev/null
+++ b/test/integration/targets/templating_lookups/template_lookups/tasks/errors.yml
@@ -0,0 +1,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