using default(omit) in a template

29 views
Skip to first unread message

taho...@gmail.com

unread,
Aug 19, 2015, 1:18:01 PM8/19/15
to Ansible Project

I am trying to use the following in a template

var = {{ param | default(omit) }}

when the template copied to the host , it looks like this

var = __omit_place_holder__ced80263bbdf6fd69a66240ad5188ab4727dd7ad

instead of what i was hoping to get which was

#var = 

any ideas on how to achieve this properly?


Matt Martz

unread,
Aug 19, 2015, 1:20:46 PM8/19/15
to ansible...@googlegroups.com
Something like:

{% if param|default('MISSING') != 'MISSING' %}
var = {{ missing }}
{% else %}
#var =
{% endif %}

There are probably other options as well, but this is largely what I use and what I see elsewhere.

--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/6c75d48e-cad4-4172-8492-7ca23ca1171d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Matt Martz
@sivel
sivel.net
Reply all
Reply to author
Forward
0 new messages