iterating using with_list

44 views
Skip to first unread message

Pshem Kowalczyk

unread,
Aug 29, 2017, 7:09:43 PM8/29/17
to Ansible Project
Hi,

I have a requirement to iterate over list of lists:

    panels:
      -
        - name: disk_used_pt
          iterate:
           - path
        - name: diskio_all
      -
        - name: system_load_all
        - name: process_all


I've tried with_items on that structure, but it flattens it to a simple list. After a bit of googling I found 'with_list' which works great (so I can iterate over the internal list using with_items), but that 'with_list' doesn't seem to be documented anywhere. Is this something that's deprecated? If so - what are the alternatives?

kind regards
Pshem

Kai Stian Olstad

unread,
Aug 30, 2017, 2:53:01 PM8/30/17
to ansible...@googlegroups.com
On 30. aug. 2017 01:09, Pshem Kowalczyk wrote:
> After a bit of googling I found 'with_list' which works great (so I
> can iterate over the internal list using with_items), but that 'with_list'
> doesn't seem to be documented anywhere. Is this something that's
> deprecated? If so - what are the alternatives?
To my knowledge Ansible have never had with_list.

So it's probably something someone have made, so you would need to hunt
it down and install it if you would like to use it.

--
Kai Stian Olstad

Pshem Kowalczyk

unread,
Aug 30, 2017, 3:57:22 PM8/30/17
to ansible...@googlegroups.com
Hmm,


Looking at the history I can see that it was added by bcoca about 2 years ago. It doesn't look like it changed much over the years (the code is trivial). So, I suspect that despite lack of documentation it is supported after all.

kind regards
Pshem


--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/0c9c7d78-112c-cad0-2fcc-98341b83d45d%40olstad.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages