1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Check for negative defined logic in conditionals

This commit is contained in:
James Cammarata 2016-11-21 10:14:53 -06:00
parent 0df3767d4d
commit 8ee3ef587a

View file

@ -125,9 +125,9 @@ class Conditional:
# variable was undefined. If we happened to be
# looking for an undefined variable, return True,
# otherwise fail
if "is undefined" in original:
if "is undefined" in original or "is not defined" in original or "not is defined" in original:
return True
elif "is defined" in original:
elif "is defined" in original or "is not undefined" in original or "not is undefined" in original:
return False
else:
raise AnsibleUndefinedVariable("error while evaluating conditional (%s): %s" % (original, e))