Hi,
I already opened an issue for my question but I was advised to come here first.
The detailed description is available under https://github.com/ansible/ansible/issues/32384
To sum it up:
I cannot manage to make the ignore_errors
work with a variable.
When I use a hardcoded boolean it works, but when I use a boolean variable it always evaluated to true (ignore errors)
`
- hosts: 127.0.0.1
vars:
ignore_assertion_errors: false
tasks:
- name: With variable
assert:
that: item < 2
msg: "{{item}} isn't < 2"
ignore_errors: ignore_assertion_errors
with_items:
- 1
- 2
- name: With 'false' as hardcoded boolean
assert:
that: item < 2
msg: "{{item}} isn't < 2"
ignore_errors: false
with_items:
- 1
- 2
`
I already tried out the following constructs
`
ignore_errors: "{{ignore_assertion_errors}}"
ignore_errors: ignore_assertion_errors
ignore_errors: "{{ignore_assertion_errors|bool}}"
ignore_errors: ignore_assertion_errors|bool
`
But always with the same result: the errors of the first task are always ignored.
Can anybody explain what I’m doing wrong, because from my current point of view this is an error.
cheers