diff --git a/lib/ansible/modules/network/ios/ios_l2_interface.py b/lib/ansible/modules/network/ios/ios_l2_interface.py index 27292bf1c4b..361e5259c6a 100644 --- a/lib/ansible/modules/network/ios/ios_l2_interface.py +++ b/lib/ansible/modules/network/ios/ios_l2_interface.py @@ -146,10 +146,9 @@ def is_switchport(name, module): def interface_is_portchannel(name, module): if get_interface_type(name) == 'ethernet': - config = get_config(module, flags=[' | section interface']) - if 'channel group' in config: + config = run_commands(module, ['show run interface {0}'.format(name)])[0] + if any(c in config for c in ['channel group', 'channel-group']): return True - return False