mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
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:
parent
4d58d16793
commit
bf1580a333
13 changed files with 768 additions and 116 deletions
|
@ -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 }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue