CiscoDevNet / ansible-dcnm

Apache License 2.0
45 stars 36 forks source link

Ansible script error while deploying link to external fabric #204

Closed smukkavi closed 1 year ago

smukkavi commented 1 year ago

Community Note

Ansible Version and collection version

Ansible version 3.0.0

DCNM version

V 12.1.1e

Affected module(s)

cisco.dcnm.dcnm_links

Ansible Playbook


 - name: Create Links including optional parameters
      cisco.dcnm.dcnm_links:
        state: merged
        src_fabric: "NEP6_Nexus_fabric"
        config:
          - dst_fabric: "External_Router"
            src_interface: "eth1/33"
            dst_interface: "TenGig6/1/2"
            src_device: "NEP6DECSP21"
            dst_device: "NEP6DSRJ21"
            template: ext_fabric_setup
            profile:
              ipv4_subnet: 7.7.7.0/31
              neighbor_ip: 7.7.7.1
              src_asn: 4294967295
              dst_asn: 64019
              mtu: 9216
              auto_deploy: false
              peer1_description: "Description of source"
              peer1_cmds:
                - no shutdown

Debug Output

Expected Behavior

Actual Behavior

It works with NDFC GUI, but Ansible script errors out while deploying external link.

  1. Created the fabric using easy fabric template and added VxLAN EVPN fabric.
  2. Created external fabric with peer BGP ASN using GUI and no external switch or router added as the external device is in different administrative control.
  3. Created link from the local fabric to external fabric along with the details of local switch name, external switch name, local interface, peer interface, Local IP/mask, remote IP, Local and remote BGP ASN and finally saved the information.
  4. As a result, the external fabric is added with the external device name while checking in the NDFC GUI.

But when I attempted to create external link as per the step-3 above using Ansible playbook, the script errored out that the external router name given in the playbook is not valid(does not exist) in the external fabric

TASK [Create Links including optional parameters] **** Error message while running the Ansible Playbook -

fatal: [lab_ndfc_server]: FAILED! => {"changed": false, "msg": "{\"Error\": \"Given switch elem = \\"NEP6DSRJ21\\" is not a valid one for this fabric\n\"}"}

References

mmudigon commented 1 year ago

@smukkavi,

Can you please check the serial numbers? Looks like serial number NEP6DSRJ21 is not valid for the fabric "External_Router"

dsx1123 commented 1 year ago

@mmudigon we should not deploy the external fabric in the below condition:

praveenramoorthy commented 1 year ago

Issue fixed as part of #220