New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ios_l2_interface - MODULE FAILURE #39011
Comments
Files identified in the description: If these files are inaccurate, please update the |
Looks like the issue exists here switch01#show running-config | ?
append Append redirected output to URL (URLs supporting append operation only)
begin Begin with the line that matches
count Count number of lines which match regexp
exclude Exclude lines that match
format Format the output using the specified spec file
include Include lines that match
redirect Redirect output to URL
tee Copy output to URL |
Looks like older devices do not support |
That is exactly what I was going to recommend. |
And to confirm, I have pulled this module locally and changed |
Switch version: switch01#show version
Cisco IOS Software, C3750 Software (C3750-IPSERVICESK9-M), Version 12.2(55)SE12, RELEASE SOFTWARE (fc2) |
Same thing for ios_l3_interface module. |
Looks like we probably need to add additional logic to this PR #39025 |
Thinking this might be the correct way (#39025): def interface_is_portchannel(name, module):
if get_interface_type(name) == 'ethernet':
config = run_commands(
module, ['show run interface {0}'.format(name)])[0]
if 'channel group' in config:
return True
elif 'channel-group' in config:
return True
return False For example if I have 3 interfaces configured as below on the switch: interface GigabitEthernet1/0/1
description unconfigured
switchport mode access
!
interface GigabitEthernet1/0/4
description unconfigured
switchport mode access
spanning-tree portfast
!
interface GigabitEthernet1/0/24
description NAS02
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 24,101,102,127-130,201
switchport mode access
channel-protocol lacp
channel-group 2 mode active
spanning-tree portfast trunk
! With the above module code change when ran using Ansible results in the following: failed: [switch01] (item={'value': {u'enabled': True, u'state': u'present', u'l2': {u'access_vlan': 1, u'state': u'unconfigured', u'mode': u'access'}, u'description': u'unconfigured', u'speed': u'auto'}, 'key': u'GigabitEthernet1/0/24'}) => {"changed": false, "item": {"key": "GigabitEthernet1/0/24", "value": {"description": "unconfigured", "enabled": true, "l2": {"access_vlan": 1, "mode": "access", "state": "unconfigured"}, "speed": "auto", "state": "present"}}, "msg": "Cannot change L2 config on physical \nport because it is in a portchannel. \nYou should update the portchannel config."}
ok: [switch01] => (item={'value': {u'description': u'unconfigured', u'enabled': True, u'state': u'present', u'l2': {u'access_vlan': 1, u'state': u'unconfigured', u'mode': u'access'}, u'l3': {u'state': u'absent', u'ipv4': []}, u'speed': u'auto'}, 'key': u'GigabitEthernet1/0/1'})
ok: [switch01] => (item={'value': {u'description': u'unconfigured', u'enabled': True, u'state': u'present', u'l2': {u'access_vlan': 1, u'state': u'unconfigured', u'mode': u'access'}, u'l3': {u'state': u'absent', u'ipv4': []}, u'speed': u'auto'}, 'key': u'GigabitEthernet1/0/4'}) |
Not sure just changing
However,
|
Ah, on second look your most recent post is using Apologies. |
@lukerussell No worries man. I noticed the same thing after going that route earlier this morning. Running through several scenarios currently and this module seems to cause me a bit of grief but nothing we cannot get around. |
@mrlesmithjr @lukerussell The PR #39658 fixes the issue. Can you try the fix and let us know? |
Hi, sorry I haven’t checked this, I don’t have any older devices in my lab and I’ve been away from work for the week. |
ISSUE TYPE
COMPONENT NAME
ios_l2_interface
ANSIBLE VERSION
CONFIGURATION
None
OS / ENVIRONMENT
I am using macOS and managing Cisco IOS 3750G devices.
SUMMARY
When using this module I keep getting the following error:
STEPS TO REPRODUCE
The following repo has all of the relevant
group_vars
and playbookEXPECTED RESULTS
The expected results should be that the l2 interfaces are managed appropriately without failures.
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: