diff --git a/lib/ansible/modules/network/ios/ios_interface.py b/lib/ansible/modules/network/ios/ios_interface.py index 34ad10ee8f..1af44f489b 100644 --- a/lib/ansible/modules/network/ios/ios_interface.py +++ b/lib/ansible/modules/network/ios/ios_interface.py @@ -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: diff --git a/test/integration/targets/ios_l3_interface/tests/cli/basic.yaml b/test/integration/targets/ios_l3_interface/tests/cli/basic.yaml index cb8f22a3f4..a2d9708168 100644 --- a/test/integration/targets/ios_l3_interface/tests/cli/basic.yaml +++ b/test/integration/targets/ios_l3_interface/tests/cli/basic.yaml @@ -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 }}" diff --git a/test/integration/targets/ios_static_route/tests/cli/basic.yaml b/test/integration/targets/ios_static_route/tests/cli/basic.yaml index 5de2c626f5..a39a98b04a 100644 --- a/test/integration/targets/ios_static_route/tests/cli/basic.yaml +++ b/test/integration/targets/ios_static_route/tests/cli/basic.yaml @@ -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 }}" diff --git a/test/integration/targets/ios_static_route/tests/cli/net_static_route.yaml b/test/integration/targets/ios_static_route/tests/cli/net_static_route.yaml index 0311f5bf46..1ae5fa3095 100644 --- a/test/integration/targets/ios_static_route/tests/cli/net_static_route.yaml +++ b/test/integration/targets/ios_static_route/tests/cli/net_static_route.yaml @@ -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