ios_l2_interface (#35054)

* Fix sending 'None' to device on ios

* Add ios_l2_interface module & tests

* Skip l2 tests on non-l2 images

* Allow test to continue on non-L2 hosts
This commit is contained in:
Nathaniel Case 2018-01-19 17:14:32 -05:00 committed by GitHub
commit bf1580a333
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 768 additions and 116 deletions

View file

@ -1,39 +1,6 @@
---
- debug: msg="START ios_l3_interface cli/basic.yaml on connection={{ ansible_connection }}"
- name: Run show version
ios_command:
commands: show version
authorize: yes
register: show_version_result
- block:
- name: Set test interface to GigabitEthernet0/1 as we are on Cisco IOS
set_fact: test_interface=GigabitEthernet0/1
- name: Set test interface 2 to GigabitEthernet0/2 as we are on Cisco IOS
set_fact: test_interface2=GigabitEthernet0/2
when: "'Cisco IOS' in show_version_result.stdout[0]"
- block:
- name: Set test interface to GigabitEthernet2 as we are on Cisco IOS-XE
set_fact: test_interface=GigabitEthernet2
- name: Disable autonegotiation on GigabitEthernet2
ios_config:
lines:
- no negotiation auto
parents: int GigabitEthernet2
authorize: yes
- name: Set test interface 2 to GigabitEthernet3 as we are on Cisco IOS-XE
set_fact: test_interface2=GigabitEthernet3
- name: Disable autonegotiation on GigabitEthernet3
ios_config:
lines:
- no negotiation auto
parents: int GigabitEthernet3
authorize: yes
when: "'Cisco IOS-XE' in show_version_result.stdout[0]"
- name: Delete interface ipv4 and ipv6 address(setup)
ios_l3_interface:
name: "{{ test_interface }}"