Re: [ansible-project] calculate from facts

2014-07-24 Thread Michael DeHaan
The precedence of the "|" is high in Jinja2. You'll need some parenthesis. On Thu, Jul 24, 2014 at 5:14 AM, Nico K. 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

Re: [ansible-project] calculate from facts

2014-07-24 Thread Nico K.
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

Re: [ansible-project] calculate from facts

2014-02-17 Thread Michael DeHaan
Also, take a look at the "set_fact" module... On Mon, Feb 17, 2014 at 10:15 AM, Brian Coca wrote: > something like {{ansible_memory * 0.75|int }} ? > > > -- > Brian Coca > Stultorum infinitus est numerus > > 011101110010011001010110111000100111011101100001011001110101001

Re: [ansible-project] calculate from facts

2014-02-17 Thread Brian Coca
something like {{ansible_memory * 0.75|int }} ? -- Brian Coca Stultorum infinitus est numerus 0111011100100110010101101110001001110111011000010110011101010010011100110110110101110111001001110111 Pedo mellon a minno -- You received this message because you ar

[ansible-project] calculate from facts

2014-02-17 Thread Patrik Uytterhoeven
hi, i would like to calculate 75% from from my memory if i read my pc memory from facts i can calculate it by multiplying it by 0.75 but that number will not always be a round number sometimes it will be a float is there anyway to calculate the facts and drop what is behind the period ? --