dcnm_links: src_interface / dst_interface case sensitivity for state == query
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
This could probably be fixed on the NX-OS side, but submitting this to see if it could be addressed within the dcnm_links module by ignoring upper/lower-case when returning results.
The problem:
N9K-C9504 reports its loopback as: loopback0 N9K-C9336C-FX2 reports its loopback as: Loopback0
If the user runs the below task, it will return no result since both interfaces are specified with "loopback0" (below, dst_interface belongs to N9K-C9336C-FX2):
- name: Query RS - BGW peering loopbacks
cisco.dcnm.dcnm_links:
state: query
src_fabric: "EF_1"
config:
- dst_fabric: "DCI"
src_interface: "loopback0"
dst_interface: "loopback0"
In contrast, the below task returns a result:
- name: Query RS - BGW peering loopbacks
cisco.dcnm.dcnm_links:
state: query
src_fabric: "EF_1"
config:
- dst_fabric: "DCI"
src_interface: "loopback0"
dst_interface: "Loopback0"
Hence, the user has to know what switch models are deployed in order to obtain correct results. It would be wonderful if dcnm_links could ignore if-name case (see JSON below) when determining whether to include a link in the result.
For reference, below is the relevant output from the second playbook above (removing non-relevant key/values for brevity).
{
"result": {
"response": [
{
"fabricName": "EF_1<->DCI",
"nvPairs": {
"DEST_FABRIC": "DCI",
"SOURCE_FABRIC": "EF_1",
},
"policyId": "POLICY-57110",
"sw1-info": {
"fabric-name": "EF_1",
"if-name": "loopback0",
"sw-model-name": "N9K-C9504",
"switch-role": "border gateway",
},
"sw2-info": {
"fabric-name": "DCI",
"if-name": "Loopback0",
"sw-model-name": "N9K-C9336C-FX2",
},
"templateName": "ext_evpn_multisite_overlay_setup"
}
]
}
}
New or Affected modules(s):
- dcnm_links
NDFC version
- V 12.1.2e
Potential ansible task config
Please reference the two ansible task examples in the Description.
@allenrobel This seems like a reasonable request. Unless there is a hidden issue here I don't see a problem with ignoring case and probably faster to fix in the collection then on NXOS
@mikewiebe Thanks Mike!