---
- hosts: all
gather_facts: no
vars:
XQWATCHER_GIT_IDENTITY: !!null
tasks:
- debug:
msg: "Test Success"
when: XQWATCHER_GIT_IDENTITY is defined
Getting this error when I run the playbook
ansible-playbook -i "localhost," test.yml -c local
PLAY [all] *********************************************************************
TASK [debug] *******************************************************************
fatal: [localhost]: FAILED! => {"failed": true, "msg": "The conditional check 'XQWATCHER_GIT_IDENTITY' failed. The error was: error while evaluating conditional (XQWATCHER_GIT_IDENTITY): 'abc' is undefined\n\nThe error appears to have been in '/Users/arbab/test-ansible/test.yml': line 8, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n tasks:\n - debug:\n ^ here\n"}