Retrieving value from nested list?

25 views
Skip to first unread message

Anthony Cheng

unread,
Jul 23, 2016, 8:31:45 PM7/23/16
to Ansible Project
Let's say if I got this ugly debug output (nested list?), how about would I go to retrieve this value?

ok: [127.0.0.1] => {
   
"foo.stdout": [
       
[
           
[
               
"bar"
           
]
       
]
   
]
}


Tried:

 with_items: "{{ foo.stdout }}"

 with_items
: "{{ foo.stdout[0] }}"


Kai Stian Olstad

unread,
Jul 24, 2016, 3:05:12 AM7/24/16
to ansible...@googlegroups.com
It's a list in a list in a list
with_items: "{{ foo.stdout[0][0] }}"

--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages