Excerpts from Michael DeHaan's message of 2014-07-18 09:21:53 -0400:
> The lookup plugin will return empty string, not None, if that env is not
> found.
> 
> However that is still False in Python.   That's curious and may be related
> to how "default" is implemented.   Will have to try that.

Jinja's `default` filter will, by default, only use the value passed to
to it if the variable in question is undefined, like, fo' real.

If you want to use the default value whenever the variable is False in
a boolean context, then use:

    my_variable|default("my_default", true)

Check it out: http://jinja.pocoo.org/docs/templates/#builtin-filters
--
Morgan Hamill

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1405691064-sup-3151%40al.wesleyan.edu.
For more options, visit https://groups.google.com/d/optout.

Reply via email to