I want to make loop on the loop in ansible to iterate through arrays.
I have two (or multiple) objects situation like this:
foo:
bar:
The items 'foo' and 'bar' are arrays and I want to iterate through each element of those arrays. As an output I want to have items like:
foo[0], foo[1], foo[3], bar[0], bar[1], bar[3]
Lets try to iterate on debug module:
- name: loop in loop
vars:
winamp:
- foo
- bar
debug:
msg: "{{ item }}"
with_items: "{{ winamp }}"
This will give only result like 'foo' and 'bar' instead of foo[0], foo[1], foo[2], bar[0], bar[1].
How to get double iteration?
- foo: [foo0,foo1]and what result do you expect.