I have defined a variable in host_vars/hostname.yml with no value assigned to it. I have the below task defined to check if the variable is empty. My play should fail.
host_vars/hostname.yml
tls_password:
- name: Check for null
fail: msg="Error value is null"
when: tls_password == ""
When I run this task it is getting skipped. Any idea how to fix this? Thanks in advance.