My jinja2 template yields correct value for the variable

{{ vars[allip.name | join("")] | default('ERR') }}

The variable has value 82.3 which gets printed by Ansible's template module.

I wish to write an if condition where I want to check if the value of the 
variable is more than 80 

{% if ( vars[allip.name | join("") | int ) > 80 %}

<th>MORE THAN 80</th>

{% endif %}


However, the 'if' the condition does not meet.

I tried  

{% if ( vars[allip.name | join("") | int  > 80 ) %}

I also tried

{% if vars[allip.name | join("") | int  > 80 %}

But, none of them worked. Can you please let me know what needs to be done 
to meet the if condition?


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/34ea1c10-1094-4583-aa71-24bb532ff99a%40googlegroups.com.

Reply via email to