diff options
author | Ricardo Carrillo Cruz <ricardo.carrillo.cruz@gmail.com> | 2017-10-25 12:44:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-25 12:44:25 +0200 |
commit | dc0aa750295e0c906c324c963ebdb4166347e4ab (patch) | |
tree | ac1f40d34a9f830b42acc1363143b3176afa1065 /test/integration/targets/ios_ping | |
parent | a9d8157e81d176a73abefefb251f4191025efaec (diff) | |
download | ansible-dc0aa750295e0c906c324c963ebdb4166347e4ab.tar.gz |
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.
Diffstat (limited to 'test/integration/targets/ios_ping')
-rw-r--r-- | test/integration/targets/ios_ping/tests/cli/ping.yaml | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/test/integration/targets/ios_ping/tests/cli/ping.yaml b/test/integration/targets/ios_ping/tests/cli/ping.yaml index e54ac6418d..08d4444fc7 100644 --- a/test/integration/targets/ios_ping/tests/cli/ping.yaml +++ b/test/integration/targets/ios_ping/tests/cli/ping.yaml @@ -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 |