On 14.02.2018 11:03, jn.be...@gmail.com 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

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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to