What does "no longer works" mean? What did you expect, what did you get?

The warning is correct - you should not use the braces in a when statement.

I'm not sure, but it sounds a bit as if the things you are comparing do not
contain the values you think they do....

Regards, K.


On Fri, Sep 13, 2019 at 7:42 PM MKPhil <[email protected]> wrote:

>
> I'm trying to compare two variables in a "when" statement - when x = y do
> something.
>
> This code works:
>
> when: unit_number == {{ disk_unit }}
>
>
> BUT I get a warning:
>
>  [WARNING]: conditional statements should not include jinja2 templating
> delimiters such as {{ }} or {% %}. Found: unit_number == {{ disk_unit }}
>
>
> If I remove the {{ }} the statement no longer works.  How should I write
> the statement so it works and doesn't give the warning?  I've tried various
> combinations of double and single quotes and round brackets.
>
>
> --
> 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/92770bd7-d206-4a8c-83a8-0c949313557d%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/92770bd7-d206-4a8c-83a8-0c949313557d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Karl Auer

Email  : [email protected]
Website: http://2pisoftware.com

GPG/PGP : 301B 1F4E 624D AD99 242C 7A68 EC24 7113 E854 4A4E
Previous: 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816

-- 
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/CA%2B%2BT08SLta3_FxEvij3qd%3D3Piy-Fs54OPOUCD9_0AG3DbFNnyQ%40mail.gmail.com.

Reply via email to