Closed digitalfiend64 closed 7 months ago
@digitalfiend64 There are couple of things that need some more clarification in order to debug this issue.
The sample playbook shared in the STEPS TO REPRODUCE
section doesn't align with the issue description or the platform this is being reported for. Can you please check that?
I inferred what the actual play might look like from the output shared in the ACTUAL RESULTS
section to be the following. Could you please confirm if that's correct?
---
- name: Test interface enabled
hosts: nxos
gather_facts: false
tasks:
- name: Update Interface Status
cisco.nxos.nxos_interfaces:
state: merged
config:
- description: Interface_Description
duplex: auto
enabled: true
ip_forward: false
mode: layer3
mtu: '9216'
name: Ethernet1/1
speed: '1000'
- description: Interface_Description
duplex: auto
enabled: true
ip_forward: false
mode: layer3
mtu: '9216'
name: Ethernet1/2
speed: '1000'
changed=True
when interface is shut and enabled=False
because of some of the default values mentioned here. As you can notice from the output, the following commands are sent to the device. This is because, the task explicitly sets the default values for the attributes - duplex
and ip_forward
which do not appear in the output for show running-config | section ^interface
causing the module code to detect this as a diff and push the commands. Note that this is unrelated to enabling/disabling the interface, which works correctly (the interfaces Eth1/29 and Eth1/30 were already in shutdown state).commands:
- interface Ethernet1/29
- duplex auto
- no ip forward
- interface Ethernet1/30
- duplex auto
- no ip forward
This will be fixed if the task is updated as such:
- name: Update Interface Status
cisco.nxos.nxos_interfaces:
state: merged
config:
- description: Interface_Description
enabled: true
mode: layer3
mtu: '9216'
name: Ethernet1/1
speed: '1000'
- description: Interface_Description
enabled: true
mode: layer3
mtu: '9216'
name: Ethernet1/2
speed: '1000'
If parameter enabled == true and interface is shut the interface is still shut and playbook shows task as 'ok'. The task should show 'changed' and no shut the interface.
, this is not reproducible for me. I've tested this with Nexus9300v chassis running NX-OS 10.3.1 and 9.3.6. The config code might be miscalculating the default switchport and shut/no shut state though for your devices. Could you please share the output of show running-config all | incl 'system default switchport'
from the affected devices?Thank you.
SUMMARY cisco.nxos.nxos_interfaces module does not enable/disable interfaces on cisco Nexus3000 C31128PQ-10GE Chassis (Nexus 9000 Series) version 7.0(3)I7(6) and cisco Nexus3000 C3232C Chassis (Nexus 9000 Series) version 7.0(3)I7(4).
ISSUE TYPE Bug Report
COMPONENT NAME
cisco.nxos.nxos_interfaces v4.4.0
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
cisco Nexus3000 C3232C Chassis (Nexus 9000 Series) version 7.0(3)I7(4)
STEPS TO REPRODUCE Run the Interface Update Implementation playbook
EXPECTED RESULTS Step #1 should shut/no shut interface
ACTUAL RESULTS Step #1 Interface does not shut/no shut