Closed oldguardmd closed 1 year ago
I can reproduce the errant behaviour. I can't enable a SVI with the current version of the nxos-Ansible Modules (3.10).
Trying to enable an existing SVI with Module cisco.nxos.nxos_interfaces
ok: [dev-switch] => {
"before": [
{
"description": "vlan_mgmt",
"fabric_forwarding_anycast_gateway": true,
"mtu": "9216",
"name": "Vlan2"
},
],
"changed": false,
"commands": [],
"invocation": {
"module_args": {
"config": [
{
"description": "vlan_mgmt",
"duplex": null,
"enabled": true,
"fabric_forwarding_anycast_gateway": true,
"ip_forward": null,
"mode": null,
"mtu": "9216",
"name": "Vlan2",
"speed": null
}
],
"running_config": null,
"state": "merged"
}
}
}
You can see that the module config for this SVI is "enabled": true
but no commands are sent to the device "commands": []
.
Runtime Data: Ansible:
ansible [core 2.12.5]
config file = /home/blub/git-workspace/ansible/VXLAN-EVPN-Datacenter/ansible.cfg
configured module search path = ['/home/blub/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.8/site-packages/ansible
ansible collection location = /home/blub/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.8.12 (default, Sep 21 2021, 00:10:52) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]
jinja version = 2.10.3
libyaml = True
Collection Version
---------- -------
cisco.nxos 3.1.0
Tested on N9kv:
Software
BIOS: version
NXOS: version 10.2(1) [Feature Release]
BIOS compile time:
NXOS image file is: bootflash:///nxos.10.2.1.F.bin
NXOS compile time: 8/23/2021 17:00:00 [08/24/2021 04:33:32]
Confirms this happens on Nexus 5672UP with NXOS 7.3(11)N1(1)
SUMMARY
If you configure a VLAN using nxos_vlan and configure an IP with nxos_l3_interfaces, there appears to be no way to enable the interface VLAN
ISSUE TYPE
COMPONENT NAME
Have tried the following: nxos_vlans nxos_l3_interfaces nxos_interfaces
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
Inventory file example can be found here: https://github.com/CiscoSE/nxos-ansible-examples/blob/AlittleBroken/MG-Demo/public.inventory.ini
Playbook can be found here: https://github.com/CiscoSE/nxos-ansible-examples/blob/AlittleBroken/MG-Demo/configDemo.yaml
Task can be found here: https://github.com/CiscoSE/nxos-ansible-examples/blob/AlittleBroken/MG-Demo/tasks/task-CreateVLANs.yaml
EXPECTED RESULTS
Ultimately I think that when I use nxos_l3_interfaces, there should be a switch to set the interface vlan to enabled:
But if the intent is to do all interface shut and no shut operations with nxos_interfaces, then that needs to work. And I would suggest providing an example under nxos_vlans that demonstrates how to create the VLAN, assign the IP, and then enable it. This is to common a task to not provide something in the way of clear guidance.
This section of my current code is suspected to be the way to do this based on other issues I reviewed, but it doesn't enable the port and returns no errors.
ACTUAL RESULTS
Completes successfully, but the interface VLAN remains in a shut state. I have to do a no shut from the CLI currently to bring up the interface vlan.