Try with
 default("127.0.0.1", true)
It is not clear on the filter description, but without the second argument
it does not perform a boolean evaluation, but just strict variable
undefinition. That means that an empty string will not trigger the default.
Actually, even if the variable you are testing is None, the default will
not be used.

Javier Palacios

On Tue, Sep 1, 2015 at 1:55 PM, Paul Tötterman <[email protected]>
wrote:

> Sorry to resurrect this old thread.
>
>
>> ansible_eth1["ipv4"]["address"] | default("127.0.0.1")
>>
>
> I tried this and it didn't work. Is it supposed to? Is there some other
> way of using default that would work? Would it make sense to fix the
> default filter to work in this case?
>
> Cheers,
> Paul
>
> --
> 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/b78f706e-30e1-4fc0-9a86-2b19924fa7bb%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/b78f706e-30e1-4fc0-9a86-2b19924fa7bb%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CANsNpUTFoe%2B-cZ1-TUf065T5%2BBGg_rNN4d73jDFC-iWB8pKfyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to