In a task, I am trying to figure out how I can loop over the items of a
list that is defined as a host variable for each host in a specific
group. This must be very common, but I can't think of a solution. I
suppose what I need is some kind of nested loops. An outer loop to loop
over the hosts in the group and an inner loop to loop over the items in
the list variable for each host in the outer loop. Is there a syntax for
this?

in hosts file:
    [somegroup]
    host1.example.org
    host2.example.org

in host1.example.org host_vars files:
    mylist:
        - item1
        - item2
        - item3

in host2.example.org host_vars files:
    mylist:
        - item4
        - item5

-- 
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/535E9153.2090804%40yahoo.gr.
For more options, visit https://groups.google.com/d/optout.

Reply via email to