On 10. feb. 2017 23:24, ZillaYT wrote:
Let me as a different question. What If I want to show ALL the files in a
debug task, like this

- debug: msg="Key = {{ item.key }} values = {{ item.value }}"
  with_dict: "{{ war_files }}"

I want to see an output like this

"msg" : "Key = server1 value = file1.war"
"msg" : "Key = server1 value = file2.war"
"msg" : "Key = server2 value = file1.war"
"msg" : "Key = server2 value = file2.war"
"msg" : "Key = server2 value = file3.war"

IOW, I want to iterate over the keys, then the values in each key.

Your item.value is a list so to list them as you want you will need a loop in a loop.
Check out loop_control
https://docs.ansible.com/ansible/playbooks_loops.html#loop-control

Or you can change you variable structure so you can do this in one loop.

--
Kai Stian Olstad

--
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/2eb5fb0d-1e4a-f10e-3484-a3976d940c8f%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to