Hello Everyone again - Trying to get the IP address of the multiple
Interfaces from a Cisco Router and register it. Using {{ item }} loop
method to feed the Multiple Interfaces (eg: GigabitEthernet 0/0/0) in the
command.
How to get the unique variables for each interface? I will pick those
variables and going to use it in the same script.
For example i want to pint the IP address of GigabitEthernet 0/0/0,
GigabitEthernet 0/0/1, GigabitEthernet 0/0/2,
*Script:*
- name: get_ip
ios_command:
commands: *"show ip interface brief {{ item }}"*
register: *var_ip_addr_{{ item }}*
with_items:
- gigabitEthernet 0/0/0
- gigabitEthernet 0/0/1
- gigabitEthernet 0/0/2
regards,RB
--
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/2d47c8ec-abf0-4b1a-8bce-0cebd8ba8090n%40googlegroups.com.