below is loop i tried:
tasks:
- name: loops
debug:
msg: "{{ item.0 }}_{{ item.1 }}_{{ item.2 }}_{{item.3}}_{{item.4}}"
loop: "{{ port | product(vserver,aggr,protocol,lif_name) | list }}"
vars:
port:
- e0a
- e0b
- e0c
- e0d
vserver:
- svm1
- svm2
aggr:
- aggr1
protocol:
- nfs
lif_name:
- 1
- 2
- 3
- 4
and I am expecting the ouput like this
svm1 e0a aggr1 nfs 1
svm1 e0b aggr1 nfs 2
svm1 e0c aggr1 nfs 3
svm1 e0d aggr1 nfs 4
svm2 e0a aggr1 nfs 1
svm2 e0b aggr1 nfs 2
svm2 e0c aggr1 nfs 3
svm2 e0d aggr1 nfs 4
but i am getting 32 entries:
along with aggr protocol and lif name:
svm1 with e0a 4 times
svm1 with e0b 4 times
svm1 with e0c 4 times
svm1 with e0d 4 times
svm2 with e0a 4 times
svm2 with e0b 4 times
svm2 with e0c 4 times
svm2 with e0d 4 times
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/22a507c1-2fd4-4926-b312-8fef7591cd5d%40googlegroups.com.