Closed digitalfiend64 closed 1 year ago
@digitalfiend64 This seems to be happening because changing the interface mode
to layer2
(via switchport
command), seems to default the MTU to 1500. However, since Ansible finds MTU set to 9216 in both the before
and expected state, it doesn't explicitly set it.
I'll update this ticket when I have a solution ready.
SUMMARY
When using the cisco.nxos.nxos_interfaces module when using the state replace the MTU is defaulted to 1500 if the original MTU is same as the one in the new config
Example before configuration: interface Ethernet1/28 description Auto_Cable_Testing mtu 9216 Configuration change data model:
After Run through the playbook:
interface Ethernet1/28 description Ansible Port Turn Up1 switchport speed 1000 duplex full no shutdown
The MTU command is no longer in the running config because ansible ignores it due to idempotency.
ISSUE TYPE
COMPONENT NAME
cisco.nxos.nxos_interfaces module
ANSIBLE VERSIO
CONFIGURATION
OS / ENVIRONMENT
NXOS: version 7.0(3)I7(6)
STEPS TO REPRODUCE
Configure a defaulted port with an MTU that matches the MTU you want to config in the module
Example before configuration: interface Ethernet1/28 description Auto_Cable_Testing mtu 9216
Example after fact gathering: Ethernet1/28: bandwidth: '10000000' description: Auto_Cable_Testing duplex: auto macaddress: 002a.105e.8b3b mtu: '9216' speed: auto-speed state: down type: 100/1000/10000 Ethernet The interfaces modules ignores the MTU key because it is the same as the original but if it doesn’t add back to the config after the switchport command is set:
commands:
EXPECTED RESULTS
Expect the module to send the tag variable with the IP address command regardless of if it is the same as the original
commands:
ACTUAL RESULTS
commands: