ansible/ansible — pull request #2937 by DazWorrall (2013-05-16 09:12:54+00:00)
Title: Raise error on undefined vars in template strings

Currently, if you have an undefined variable in a template string in a playbook, the _un-rendered_ template is returned - this has caught us out a couple of times (users named "{{ username }}"!), so I wanted to see if I could turn on jinja2's "StrictUndefined" behaviour - however the code already [uses this][0], but squashes the exception and returns the template un-rendered explicitly. It looks like this isn't intentional though, so here's a quick patch and test to fix it.

[0]:https://github.com/ansible/ansible/blob/devel/lib/ansible/utils/template.py#L465