You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are trying to use the cisco.nxos.nxos_vrf module along with the aggregate parameter and a list of interfaces for each VRF to assign the interfaces to the appropriate VRF.
The module works fine as long as the interface is not a sub-interface, for example Ethernet1/1.3901. When a sub-interface is listed in the aggregate.interfaces list, the module attempts to issue "no switchport" which is invalid on a sub-interface.
ISSUE TYPE
Bug Report
COMPONENT NAME
cisco.nxos.nxos_vrf module using the aggregate parameter along with a list of interfaces.
I would expect each interface (physical, logical) that has sub-interfaces to be properly configured with a vrf member statement. For example:
interface Ethernet1/1.3901
description SHS VRF v3901
encapsulation dot1q 3901
vrf member SHS
ip address 10.92.130.61/30
no shutdown
It appears that there is no distinction given between a standard Ethernet1/x interface and a sub-interface. This is likely to be a problem with sub-interfaces that have a parent of a port-channel interface.
if get_interface_type(i) in (
"ethernet",
"portchannel",
):
commands.append("no switchport")
It does not look like the module utility get_interface_type() distinguishes between the physical interface and the sub-interface. A possible solution to this specific issue, might be to add an additional check to see if the Ethernet or Port-channel interface is a sub-interface by checking the length of the interface after splitting on a period '.'
if get_interface_type(i) in (
"ethernet",
"portchannel",
) **and len(i.split('.')) < 2** :
commands.append("no switchport")
SUMMARY
We are trying to use the cisco.nxos.nxos_vrf module along with the aggregate parameter and a list of interfaces for each VRF to assign the interfaces to the appropriate VRF.
The module works fine as long as the interface is not a sub-interface, for example Ethernet1/1.3901. When a sub-interface is listed in the aggregate.interfaces list, the module attempts to issue "no switchport" which is invalid on a sub-interface.
ISSUE TYPE
COMPONENT NAME
cisco.nxos.nxos_vrf module using the aggregate parameter along with a list of interfaces.
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Switch
Control Node
STEPS TO REPRODUCE
host_vars
role tasks
EXPECTED RESULTS
I would expect each interface (physical, logical) that has sub-interfaces to be properly configured with a vrf member statement. For example:
It appears that there is no distinction given between a standard Ethernet1/x interface and a sub-interface. This is likely to be a problem with sub-interfaces that have a parent of a port-channel interface.
If appears that line 332 (among others) of the source file https://github.com/ansible-collections/cisco.nxos/blob/main/plugins/modules/nxos_vrf.py
does a check to see if the interface is of type ethernet or port-channel and then appends the command "no switchport" if true.
It does not look like the module utility get_interface_type() distinguishes between the physical interface and the sub-interface. A possible solution to this specific issue, might be to add an additional check to see if the Ethernet or Port-channel interface is a sub-interface by checking the length of the interface after splitting on a period '.'
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: