mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix ios integration test failures (#35333)
This commit is contained in:
parent
dd949c5b65
commit
c216473c82
4 changed files with 26 additions and 2 deletions
|
@ -184,7 +184,7 @@ def validate_param_values(module, obj, param=None):
|
|||
def parse_shutdown(configobj, name):
|
||||
cfg = configobj['interface %s' % name]
|
||||
cfg = '\n'.join(cfg.children)
|
||||
match = re.search(r'shutdown', cfg, re.M)
|
||||
match = re.search(r'^shutdown', cfg, re.M)
|
||||
if match:
|
||||
return True
|
||||
else:
|
||||
|
|
|
@ -8,6 +8,16 @@
|
|||
authorize: yes
|
||||
register: result
|
||||
|
||||
- name: Setup - Ensure interfaces are switchport
|
||||
ios_config:
|
||||
lines:
|
||||
- no shutdown
|
||||
parents:
|
||||
- "interface {{ item }}"
|
||||
loop:
|
||||
- "{{ test_interface }}"
|
||||
- "{{ test_interface2 }}"
|
||||
|
||||
- name: Configure interface ipv4 address
|
||||
ios_l3_interface:
|
||||
name: "{{ test_interface }}"
|
||||
|
|
|
@ -1,4 +1,16 @@
|
|||
---
|
||||
- debug: msg="START ios cli/ios_static_route.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
- name: delete static route - setup
|
||||
net_static_route:
|
||||
prefix: 172.16.31.0
|
||||
mask: 255.255.255.0
|
||||
next_hop: 10.0.0.8
|
||||
admin_distance: 1
|
||||
state: absent
|
||||
authorize: yes
|
||||
register: result
|
||||
|
||||
- name: create static route
|
||||
ios_static_route:
|
||||
prefix: 172.16.31.0
|
||||
|
@ -127,3 +139,5 @@
|
|||
that:
|
||||
- 'result.changed == true'
|
||||
- 'result.commands == ["no ip route 172.16.32.0 255.255.255.0 10.0.0.8", "no ip route 172.16.34.0 255.255.255.0 10.0.0.8"]'
|
||||
|
||||
- debug: msg="END ios cli/ios_static_route.yaml on connection={{ ansible_connection }}"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
prefix: 172.16.31.0
|
||||
mask: 255.255.255.0
|
||||
next_hop: 10.0.0.8
|
||||
admin_distance: 2
|
||||
admin_distance: 1
|
||||
state: absent
|
||||
authorize: yes
|
||||
register: result
|
||||
|
|
Loading…
Reference in a new issue