Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dcnm_links: src_interface / dst_interface case sensitivity for state == query #216

Open
allenrobel opened this issue Apr 14, 2023 · 2 comments

Comments

@allenrobel
Copy link
Collaborator

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.

@mikewiebe
Copy link
Collaborator

@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

@allenrobel
Copy link
Collaborator Author

@mikewiebe Thanks Mike!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants