Skip to content

Add FEC on dcnm_interface for ND4.1#661

Draft
ccoueffe wants to merge 3 commits intoCiscoDevNet:developfrom
ccoueffe:add_fec_nd41
Draft

Add FEC on dcnm_interface for ND4.1#661
ccoueffe wants to merge 3 commits intoCiscoDevNet:developfrom
ccoueffe:add_fec_nd41

Conversation

@ccoueffe
Copy link
Copy Markdown
Collaborator

@ccoueffe ccoueffe commented Mar 30, 2026

#660

Use existing plugin: version_compare to compare and push only if ND >= 4.1.1

---
- name: test inventory
  hosts: nac-ndfc1
  gather_facts: false

  tasks:

  - name: Configure 25G with fc-fec on E1/12
    cisco.dcnm.dcnm_interface:
      fabric: "nac-ndfc1"
      state: merged
      config:
        - name: eth1/12
          type: eth
          switch:
            - "10.229.42.121"
          deploy: false
          profile:
            mode: trunk
            admin_state: true
            speed: 25Gb
            fec: rs-fec
            description: "ETH 1/12 25G fc-fec"
TASK [Configure 25G with fc-fec on E1/12] *************************************************************************************************
task path: /Users/ccoueffe/Documents/Devnet/NDFC-Ansible-As-Code/ndfc-ansbile-as-code/nac-ndfc/playbooks/play-interface_fec.yaml:8
Monday 30 March 2026  14:45:06 +0200 (0:00:00.053)       0:00:00.053 ********** 
Monday 30 March 2026  14:45:06 +0200 (0:00:00.053)       0:00:00.053 ********** 
changed: [nac-ndfc1] => {
    "changed": true,
    "diff": [
        {
            "debugs": [],
            "deferred": [],
            "delete_deploy": [],
            "deleted": [],
            "deploy": [],
            "merged": [
                {
                    "interfaceType": "INTERFACE_ETHERNET",
                    "interfaces": [
                        {
                            "ifName": "Ethernet1/12",
                            "nvPairs": {
                                "FEC": "rs-fec"
                            }
                        }
                    ]
                }
            ],
            "overridden": [],
            "query": [],
            "replaced": [],
            "skipped": []
        }
    ],
    "invocation": {
        "module_args": {
            "check_deploy": false,
            "config": [
                {
                    "deploy": false,
                    "name": "eth1/12",
                    "profile": {
                        "admin_state": true,
                        "description": "ETH 1/12 25G fc-fec",
                        "fec": "rs-fec",
                        "mode": "trunk",
                        "speed": "25Gb"
                    },
                    "switch": [
                        "10.229.42.121"
                    ],
                    "type": "eth"
                }
            ],
            "deploy": true,
            "fabric": "nac-ndfc1",
            "override_intf_types": [],
            "state": "merged"
        }
    },
    "response": [
        {
            "DATA": {},
            "MESSAGE": "OK",
            "METHOD": "PUT",
            "REQUEST_PATH": "https://x.x.x.x:443/appcenter/cisco/ndfc/api/v1/lan-fabric/rest/interface",
            "RETURN_CODE": 200
        }
    ]
}

PLAY RECAP ********************************************************************************************************************************
nac-ndfc1                  : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

Second run indepotent

TASK [Configure 25G with fc-fec on E1/12] *************************************************************************************************
task path: /Users/ccoueffe/Documents/Devnet/NDFC-Ansible-As-Code/ndfc-ansbile-as-code/nac-ndfc/playbooks/play-interface_fec.yaml:8
Monday 30 March 2026  14:50:22 +0200 (0:00:00.054)       0:00:00.054 ********** 
Monday 30 March 2026  14:50:22 +0200 (0:00:00.054)       0:00:00.054 ********** 
ok: [nac-ndfc1] => {
    "changed": false,
    "diff": [
        {
            "debugs": [],
            "deferred": [],
            "delete_deploy": [],
            "deleted": [],
            "deploy": [],
            "merged": [],
            "overridden": [],
            "query": [],
            "replaced": [],
            "skipped": []
        }
    ],
    "invocation": {
        "module_args": {
            "check_deploy": false,
            "config": [
                {
                    "deploy": false,
                    "name": "eth1/12",
                    "profile": {
                        "admin_state": true,
                        "description": "ETH 1/12 25G fc-fec",
                        "fec": "rs-fec",
                        "mode": "trunk",
                        "speed": "25Gb"
                    },
                    "switch": [
                        "10.229.42.121"
                    ],
                    "type": "eth"
                }
            ],
            "deploy": true,
            "fabric": "nac-ndfc1",
            "override_intf_types": [],
            "state": "merged"
        }
    },
    "response": []
}

PLAY RECAP ********************************************************************************************************************************
nac-ndfc1                  : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   


PLAYBOOK RECAP ****************************************************************************************************************************
Playbook run took 0 days, 0 hours, 0 minutes, 6 seconds

Using Replaced

  - name: Configure 25G with fc-fec on E1/12
    cisco.dcnm.dcnm_interface:
      fabric: "nac-ndfc1"
      state: replaced
      config:
        - name: eth1/12
          type: eth
          switch:
            - "10.229.42.121"
          deploy: false
          profile:
            mode: trunk
            admin_state: true
            speed: 25Gb
            fec: fc-fec
            description: "ETH 1/12 25G fc-fec"
Monday 30 March 2026  14:52:11 +0200 (0:00:00.063)       0:00:00.063 ********** 
changed: [nac-ndfc1] => {
    "changed": true,
    "diff": [
        {
            "debugs": [],
            "deferred": [],
            "delete_deploy": [],
            "deleted": [],
            "deploy": [],
            "merged": [],
            "overridden": [],
            "query": [],
            "replaced": [
                {
                    "interfaceType": "INTERFACE_ETHERNET",
                    "interfaces": [
                        {
                            "ifName": "Ethernet1/12",
                            "nvPairs": {
                                "FEC": "fc-fec"
                            }
                        }
                    ]
                }
            ],
            "skipped": []
        }
    ],
    "invocation": {
        "module_args": {
            "check_deploy": false,
            "config": [
                {
                    "deploy": false,
                    "name": "eth1/12",
                    "profile": {
                        "admin_state": true,
                        "description": "ETH 1/12 25G fc-fec",
                        "fec": "fc-fec",
                        "mode": "trunk",
                        "speed": "25Gb"
                    },
                    "switch": [
                        "10.229.42.121"
                    ],
                    "type": "eth"
                }
            ],
            "deploy": true,
            "fabric": "nac-ndfc1",
            "override_intf_types": [],
            "state": "replaced"
        }
    },
    "response": [
        {
            "DATA": {},
            "MESSAGE": "OK",
            "METHOD": "PUT",
            "REQUEST_PATH": "https://x.x.x.x:443/appcenter/cisco/ndfc/api/v1/lan-fabric/rest/interface",
            "RETURN_CODE": 200
        }
    ]
}

PLAY RECAP ********************************************************************************************************************************
nac-ndfc1                  : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   


PLAYBOOK RECAP ****************************************************************************************************************************
Playbook run took 0 days, 0 hours, 0 minutes, 7 seconds

Test with Access mode

  - name: Configure 25G with fc-fec on E1/12
    cisco.dcnm.dcnm_interface:
      fabric: "nac-ndfc1"
      state: replaced
      config:
        - name: eth1/12
          type: eth
          switch:
            - "10.229.42.121"
          deploy: false
          profile:
            mode: access
            admin_state: true
            speed: 25Gb
            fec: fc-fec
            description: "ETH 1/12 25G fc-fec"
Monday 30 March 2026  14:54:50 +0200 (0:00:00.048)       0:00:00.048 ********** 
changed: [nac-ndfc1] => {
    "changed": true,
    "diff": [
        {
            "debugs": [],
            "deferred": [],
            "delete_deploy": [],
            "deleted": [],
            "deploy": [],
            "merged": [],
            "overridden": [],
            "query": [],
            "replaced": [
                {
                    "interfaceType": "INTERFACE_ETHERNET",
                    "interfaces": [
                        {
                            "fabricName": "nac-ndfc1",
                            "ifName": "Ethernet1/12",
                            "interfaceType": "INTERFACE_ETHERNET",
                            "nvPairs": {
                                "ACCESS_VLAN": "",
                                "ADMIN_STATE": "true",
                                "BPDUGUARD_ENABLED": "true",
                                "CDP_ENABLE": true,
                                "CONF": "",
                                "DESC": "ETH 1/12 25G fc-fec",
                                "ENABLE_MONITOR": false,
                                "ENABLE_ORPHAN_PORT": false,
                                "ENABLE_PFC": false,
                                "ENABLE_QOS": false,
                                "FEC": "fc-fec",
                                "INTF_NAME": "Ethernet1/12",
                                "MTU": "jumbo",
                                "PORTTYPE_FAST_ENABLED": "true",
                                "PORT_DUPLEX_MODE": "auto",
                                "QOS_POLICY": "",
                                "QUEUING_POLICY": "",
                                "SPEED": "25Gb"
                            },
                            "serialNumber": "9YWYW0DZU81"
                        }
                    ],
                    "policy": "int_access_host"
                }
            ],
            "skipped": []
        }
    ],
    "invocation": {
        "module_args": {
            "check_deploy": false,
            "config": [
                {
                    "deploy": false,
                    "name": "eth1/12",
                    "profile": {
                        "admin_state": true,
                        "description": "ETH 1/12 25G fc-fec",
                        "fec": "fc-fec",
                        "mode": "access",
                        "speed": "25Gb"
                    },
                    "switch": [
                        "10.229.42.121"
                    ],
                    "type": "eth"
                }
            ],
            "deploy": true,
            "fabric": "nac-ndfc1",
            "override_intf_types": [],
            "state": "replaced"
        }
    },
    "response": [
        {
            "DATA": {},
            "MESSAGE": "OK",
            "METHOD": "PUT",
            "REQUEST_PATH": "https://x.x.x.x:443/appcenter/cisco/ndfc/api/v1/lan-fabric/rest/interface",
            "RETURN_CODE": 200
        }
    ]
}

PLAY RECAP ********************************************************************************************************************************
nac-ndfc1                  : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

@ccoueffe ccoueffe marked this pull request as ready for review March 30, 2026 13:05
@ccoueffe ccoueffe marked this pull request as draft March 30, 2026 16:40
@ccoueffe ccoueffe marked this pull request as draft March 30, 2026 16:40
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

Successfully merging this pull request may close these issues.

1 participant