with_items:
- {{ ansible_all_ipv4_addresses }}
- {{ ansible_all_ipv6_addresses | ipv6('public') }}
- tcpports
^ will flatten to single list
or you can use union to get unique single list:
with_items: "{{
tcpports|union(ansible_all_ipv4_addresses|union(ansible_all_ipv6_addresses
| ipv6('public')))}}"
On Thu, Feb 11, 2016 at 7:12 PM, nusenu <[email protected]> wrote:
> Hi,
>
> similar to a question from about a year ago [1], I'm looking for the
> best way to loop over 3 lists:
>
> - {{ ansible_all_ipv4_addresses }}
> - {{ ansible_all_ipv6_addresses | ipv6('public') }}
> - tcpports
>
>
> ipv4 and ipv6 IPs should iterate in parallel (I'll check that their list
> lengths are matching) while tcpports should be combined in nested mode.
>
>
> I guess this is a common use-case?
>
>
>
>
>
>
> [1] https://groups.google.com/d/msg/ansible-devel/aLrH_SC8HyY/Zz91ifV5M-0J
>
> --
> 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/56BD235A.2070107%40openmailbox.org
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
----------
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/CACVha7cMB-sGJ_29DCkMKjKmujcDgh3u2YZPrV7RBrOtG0VG4Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.