Nusenu1
(Nusenu)
February 18, 2015, 5:43pm
1
Hi,
I've got 3 sets of data:
foo: [ A, B, C, D, ...]
bar: [ 1, 2 ]
tra: [ a, b ]
foo should be combined with bar and tra in a nested loop, but bar and
tra should loop together.
something like (not actually working):
- debug: msg="{{ item[0] }} {{ item[1][0] }} {{ item[1][1] }}
with_netsted:
- foo
- item
with_together:
- bar
- tra
Expected output:
A1a
A2b
B1a
B2b
C1a
C2b
...
How would I actually combine with_nested: and with_together?
thanks!
Nusenu
Brian_Coca
(Brian Coca)
February 18, 2015, 6:25pm
2
they are lookups, so you can do with_<lookup1>: lookup('lookup2 ....)
Nusenu1
(Nusenu)
February 18, 2015, 7:13pm
3
Brian Coca:
they are lookups, so you can do with_<lookup1>: lookup('lookup2
....)
I'm sorry it is not entirely clear to me yet.
I didn't find something like this in the documentation at:
http://docs.ansible.com/playbooks_lookups.html
http://docs.ansible.com/playbooks_loops.html
Could you point me to the documentation or provide an example?
thanks!
Nusenu
Nusenu1
(Nusenu)
February 18, 2015, 9:53pm
4
Sorry, after reading [1] I figured I'm on the wrong list.
To be honest I was surprised that the user documentation [2] links to a
*-devel list for further help:
"
User Mailing List (points to http://groups.google.com/group/ansible-devel )
Have a question? Stop by the google group!
"
I guess this should actually point to
http://groups.google.com/group/ansible-project , no?
Now I'm off to the ansible-project list - sorry for the off-topic post.
[1] https://groups.google.com/d/msg/ansible-devel/lhvukkszKUA/S2DO7eqOvY0J
[2] http://docs.ansible.com/playbooks_loops.html (this is just an
example almost any documentation page has that link)
Nice catch. Looks like there's something busted in the template there -- thanks!
--g