On 17. aug. 2017 17:18, Mark Huang wrote:
What is the proper syntax for trying to do something like this? It works
fine but it gives me a warning that says not to use templating delimiters.

when: "{{ customer }}.aws_cloud_formation_state == 'present'"

I have tried just doing

when: customer.aws_cloud_formation_state == 'present'

but that just goes into the customer dictionary looking for
aws_cloud_formation. I would like to take a variable 'customer' and use it
as the conditional. It works fine, but what is the correct syntax for
getting it to work without giving a warning.
You need to use vars

when: vars[customer].aws_cloud_formation_state == 'present'

--
Kai Stian Olstad

--
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/6dd67428-d1d8-2bcb-5d15-112f3aeb4f44%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to