Hello,
I was wondering, whether it is possible to loop through an array instead generating a line for each element in array.
Extract:
:
vars:
ansible_become_pass: "{{ vault_sudo_password }}"
ansible_python_interpreter: /usr/bin/python3
prefix:
- 10.0.0.0/24
- 10.0.1.0/24
- 10.0.2.0/24
:
- name: Task3- remove prefix
ios_config:
commands:
- no ip prefix-list bgp-net permit {{prefix[0]}}
when: output2.stdout is search ~prefix[0]
- name: Task4- remove prefix
ios_config:
commands:
- no ip prefix-list bgp-net permit {{prefix[1]}}
when: output2.stdout is search ~prefix[1]
:
Please advise.
Thanks.