Skip to content

dcnm_fabric: RP_COUNT Integer Validation Fails - Type Conversion Inconsistency in Parameter Rules #441

@skaszlik

Description

@skaszlik

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

Ansible Version and collection version

ansible [core 2.16.3]
python version = 3.10.14
jinja version = 3.1.6

DCNM version

NDFC "version": "12.2.2.241"

Affected module(s)

  • dcnm_fabric

Ansible Playbook

---
- hosts: nac-fabric1
  any_errors_fatal: true
  collections:
    - cisco.dcnm

  vars:
    fabric_name: "nac-fabric1" 
    switch_ip: "198.18.133.14"

  tasks:    
    - name: Update fabrics (nac test)
      cisco.dcnm.dcnm_fabric:
        state: merged
        config:
        - FABRIC_NAME: nac-fabric1
          FABRIC_TYPE: VXLAN_EVPN
          DEPLOY: False

          BGP_AS: "65011"
          UNDERLAY_IS_V6: False
          FABRIC_INTERFACE_TYPE: p2p
          SUBNET_TARGET_MASK: 30
          LINK_STATE_ROUTING: ospf
          ANYCAST_GW_MAC: 12:34:56:78:90:00

          REPLICATION_MODE: Multicast
          RP_COUNT: 4
          RP_MODE: bidir
          RP_LB_ID: 254
          ENABLE_TRM: False
          MULTICAST_GROUP_SUBNET: 239.1.1.0/25
          PHANTOM_RP_LB_ID1: 2
          PHANTOM_RP_LB_ID2: 3
          PHANTOM_RP_LB_ID3: 114
          PHANTOM_RP_LB_ID4: 115

Debug Output

https://gist.github.com/skaszlik/0dfa70be57b145abbc941b4e18b8d3df

Expected Behavior

The validation should allow the configuration

Actual Behavior

The issue is in the validation logic. When comparing values, there appears to be a type mismatch. The verify_playbook_params.py module converts some values during validation.

ansible_collections/cisco/dcnm/plugins/module_utils/fabric/verify_playbook_params.py

But when comparing in the ruleset, it's likely expecting a specific type (string vs integer), causing the comparison to fail even though the values are numerically equal.

User/Symptom Focus:

  • "PHANTOM_RP_LB_ID Parameters Reject Valid RP_COUNT Integer Values"
  • "Fabric Validation Incorrectly Rejects Integer Parameters from YAML"
  • "RP_COUNT: 4 Fails Validation While RP_COUNT: '4' Works"
  • "ConversionUtils.make_int() Not Applied Consistently in verify_playbook_params.py"
  • "Fabric Parameter Validation Missing Integer Type Normalization"

Steps to Reproduce

Run the provided example ansible playbook

References

The issue is describe in netascode/ansible-dc-vxlan repo:
netascode/ansible-dc-vxlan#425

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions