Skip to content

Instantly share code, notes, and snippets.

@jctanner
Created June 13, 2019 13:52
Show Gist options
  • Save jctanner/63c7786fc9b7e1974d7bb6105eb81b8a to your computer and use it in GitHub Desktop.
Save jctanner/63c7786fc9b7e1974d7bb6105eb81b8a to your computer and use it in GitHub Desktop.
diff --git a/lib/ansible/playbook/base.py b/lib/ansible/playbook/base.py
index 74f079e..e1909f8 100644
--- a/lib/ansible/playbook/base.py
+++ b/lib/ansible/playbook/base.py
@@ -376,7 +376,11 @@ class FieldAttributeBase(with_metaclass(BaseMeta, object)):
value = getattr(self, name)
else:
# if the attribute contains a variable, template it now
- value = templar.template(getattr(self, name))
+ try:
+ value = templar.template(getattr(self, name))
+ except AttributeError as e:
+ print('ERROR: %s created %s' % (getattr(self, name), e))
+ raise e
# if this evaluated to the omit value, set the value back to
# the default specified in the FieldAttribute and move on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment