The precedence of the "|" is high in Jinja2.   You'll need some parenthesis.




On Thu, Jul 24, 2014 at 5:14 AM, Nico K. <[email protected]> wrote:

> I'm actually using this in a template, however the behavior is not as
> expected:
>
> someVar = {{ ansible_memtotal_mb / 4|int }}
>
> The result is '256.0', same when I remove the |int and same when I do *
> 0.25.
>
>
> Op maandag 17 februari 2014 16:15:07 UTC+1 schreef Brian Coca:
>
>> something like {{ansible_memory * 0.75|int }} ?
>>
>>
>> --
>> Brian Coca
>> Stultorum infinitus est numerus
>> 011000010111001001100101011011100010011101110100001000000111
>> 100101101111011101010010000001110011011011010110000101110010
>> 0111010000100001
>> Pedo mellon a minno
>>
>  --
> 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/1906f097-2e7c-4ba2-bed3-48dbbb5278b5%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/1906f097-2e7c-4ba2-bed3-48dbbb5278b5%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/CA%2BnsWgxsyBMY-2xzosVcQ2r5BnsgqEAN3d04NYFLh4Lyf6RXYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to