On 14.02.2018 11:03, [email protected] wrote:
Another approach:

- name: check required vars
  fail: msg="Variable '{{ item }}' is not defined"
  when: item not in vars
  with_items: "{{required_vars}}"

Workes, but you cannot check the value of the variable, just if it is not
undefined.

This should work

when: vars[item] is not defined or vars[item] == ""

--
Kai Stian Olstad

--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f1b9b2ee97dd30801f5c16847f3a158c%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to