On 27. mai 2017 13:40, Jörg Kastning wrote:
Am Freitag, 26. Mai 2017 18:12:43 UTC+2 schrieb Kai Stian Olstad:
In your case you need to do what the warning says, remove the "{{ and
the }}" and the warning will be gone.

    when: ("Complete!" in yum_output.stdout_lines[-1]) or
          ("Komplett!" in yum_output.stdout_lines[-1])


Thanks for helping me Kai. I appreciate it.

You're welcome.


Brian wrote:

There are just 2 contexts, normal (you require them) and conditionals
(anything with when:) which don't. It is consistent, juts not uniform.


I do not understand the need for two different contexts here? Why could it
not kept the way like it was in Ansible <2.3.

In some other context that way did cause errors.

If the Jinja template context was removed from when your way of writing it would fail. The reason for this is that "string" in a.variable is a Jinja expression
http://jinja.pocoo.org/docs/dev/templates/#other-operators

If removed you would have to add the {{ at the beginning and }} at the end like every time like so.

  when: "{{ ("Complete!" in yum_output.stdout_lines[-1]) or
            ("Komplett!" in yum_output.stdout_lines[-1]) }}"

--
Kai Stian Olstad

--
Kai Stian Olstad

--
You received this message because you are subscribed to the Google Groups "Ansible 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to