I have a the below in my groups vars, and in a role I am trying to add a conditional on module-a
such as when: " ‘module-a’ in module" but keeps throwing me this error
{“msg”: "The conditional check ’ ‘module-a’ in modules’ failed. The error was: error while evaluating conditional ( ‘module-a’ in modules): Unable to look up a name or access an attribute in template string ({% if 'module-a in modules %} True {% else %} False {% endif %}).\nMake sure your variable name does not contain invalid characters like ‘-’: argument of type ‘AnsibleUndefined’ is not iterable…
but somehow it works when I put this in the playbook itself…
Did anyone had such an issue? Or… any idea why this works on the playbook but not under gorup_vars/all…??
vars:
module:
- module-a