Introspect platform before running ios tests (#32125)

In some IOS tests, we can't just assume a certain interface, as
we test on IOS and IOS-XE and in our CI they scheme numbering is
different.
Introspect version on the tests where needed.
This commit is contained in:
Ricardo Carrillo Cruz 2017-10-25 12:44:25 +02:00 committed by GitHub
commit dc0aa75029
2 changed files with 31 additions and 7 deletions

View file

@ -1,10 +1,20 @@
---
- debug: msg="START cli/ping.yaml"
- name: Get show ip interface GigabitEthernet0/0 output
- ios_command:
commands: show version
register: show_version_result
- set_fact: management_interface=GigabitEthernet0/0
when: "'Cisco IOS' in show_version_result.stdout[0]"
- set_fact: management_interface=GigabitEthernet1
when: "'Cisco IOS-XE' in show_version_result.stdout[0]"
- name: Get show ip management nterface output
ios_command:
commands:
- show ip interface GigabitEthernet0/0 | include Internet address
- show ip interface "{{ management_interface }}" | include Internet address
authorize: yes
register: show_ip_interface_result