> 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.


My dirty fix was to put them into a dict:

   - set_fact:
        ips:
            ipv4: "{{ item.0 }}"
            ipv6: "{{ item.1 }}"
     with_together:
        - "{{ ansible_all_ipv4_addresses }}"
        - "{{ ansible_all_ipv6_addresses }}"
     register: ips

   - set_fact: tor_ips="{{ ips.results |
map(attribute='ansible_facts.ips')|list}}"


nicer solutions are still appreciated :)

-- 
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/56BE671D.3010006%40openmailbox.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to