"which looks bad, and tells you about {{ }} not being needed (which is not
true in this case...)."
The real fix would be to evaluate things as far recursively as we can, IMHO.
So as long as we have a ticket for that (let's be sure we have one) {{ foo
}} will become uneeded and we don't need to change the warning.
On Sun, Mar 23, 2014 at 9:05 AM, Tomasz Kontusz <[email protected]>wrote:
> On 23.03.2014 12:42, Arie Skliarouk wrote:
>
>> The following playbook does not work properly - the action is always
>> executed, why is that?
>>
>> ---
>> - hosts: *
>> vars:
>> x: 5
>> y: 7
>> is_false1: x>y
>> is_false2: x>y
>>
> Here you set is_false1 and is_false2 to strings "x>y", not to a result of
> evaluating it (and it would be the same if you put {{ }} around it)
>
> tasks:
>>
>> - name: either is true
>> shell: echo either is true
>> when: is_false1 or is_false2
>>
> And here you check if either is_false1 or is_false2 is true-like - which
> they both are, as they are non-empty strings. What would work is putting
> them in {{ }} like this:
>
> when: '{{ is_false1 }} or {{ is_false2 }}'
>
> which looks bad, and tells you about {{ }} not being needed (which is not
> true in this case...).
>
>
> --
> 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/532EDC0D.9040803%40gmail.com.
>
> 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/CAEVJ8QNc8FZPvpHzvBEYaSF9avA2wO%2B4JV5Ye_wOkxN-9p3mkg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.