Thanks for the feedback, it took a bit for me to understand.  I think I 
might be better off declare them individually in my example since that is 
much easier for other to read and add to and I can see possible text errors 
with all the brackets and parens that have to be used for each additional 
item. (say I wanted to add 3 more variables to check)

On Monday, February 8, 2016 at 10:22:38 AM UTC-8, Brian Coca wrote:
>
> when executes inside the loop so it cannot prevent undefined errors, 
> the following does a union of the lists but makes sure to default each 
> to an empty list in case they are undefined: 
>
> with_items:"{{nginx_domain|default([])|union(nginx_port|default([]))}}" 
>
>
>
>
> -- 
> Brian Coca 
>

-- 
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/c3e00435-0d45-48b8-9595-eabedd606ce8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to