Open Miyoshi-Ryota opened 1 month ago
It's a WIP. I will test this change for real device.
All my work is completed and it is ready for review.
Since Version class bug also affects the functionality I want to add this time, I have made the corrections within the same PR. However, if it needs to be split into two separate PRs, please let me know. https://github.com/ansible-collections/cisco.nxos/pull/877/commits/3cb4fef5bb939c584aef49db8774c5f9d4a47f24
SUMMARY
Add
vrf
option tonxos_nxapi
module.Comments on the design:
It's an old module with only state: present / absent. As far as I can see, when state: present is specified, it does not change parameters that are not mentioned. For example, if the
nxapi sandbox
command is already present on the device but the sandbox parameter is not specified in the playbook, it results that no deletion or other actions are taken.Therefore, the vrf option follows this design.
Not applying the configuration at all. This is because while it is possible to specify another VRF, but there is no way to reflect the absence of a parameter. This aligns with the aforementioned behavior of state:
nxapi use-vrf
command at all means enabling nxapi for all VRFs. However, in my implementation of this module, there is currently no way to remove an already applied nxapi use-vrfpresent
where nothing is done if a parameter is not specified.This implementation method was chosen to maintain consistency within the module, avoid disrupting environments using the existing nxos_nxapi module, and keep the parameters simple.
Other possible approaches:
If you prefer to select one of other two approaches I mentioned, or an entirely different approach, please let me know. I am willing to make adjustments accordingly.
Reference for the supported versions of use-vrf:
For N9K:
For N7K:
https://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus7000/sw/programmability/guide/cisco_nexus7000_programmability_guide_8x/b-cisco-nexus7000-programmability-guide-8x_chapter_011.html
For N3K:
ISSUE TYPE
COMPONENT NAME
nxos_nxapi_module
ADDITIONAL INFORMATION