CiscoDevNet / ansible-dcnm

Apache License 2.0
45 stars 36 forks source link

dcnm_vrf: The peer_vrf parameter is mandatory in Ansible script whereas it's optional in NDFC GUI #206

Closed smukkavi closed 1 year ago

smukkavi commented 1 year ago

Community Note

Ansible Version and collection version

3.0.0

DCNM version

Affected module(s)

Ansible Playbook


 - name: Merge vrfs
    cisco.dcnm.dcnm_vrf:
      fabric: "{{ FABRIC }}"
      state: merged
      config:
      - vrf_name: "{{ vrf.vrf_name }}"
        vrf_id: "{{ vrf.vrf_id }}"
        import_vpn_rt:         "{{ vrf.import_vpn_rt }}"
        export_vpn_rt:         "{{ vrf.export_vpn_rt }}"
        adv_default_routes:    "{{ vrf.adv_default_routes }}"
        static_default_route:  "{{ vrf.static_default_route }}"
        adv_host_routes:       "{{ vrf.adv_host_routes }}"
        vrf_template: Default_VRF_Universal
        vrf_extension_template: Default_VRF_Extension_Universal
        vlan_id: "{{ vrf.vlan_id }}"
        service_vrf_template: null
        deploy: true
        attach: "{{ vrf_lite_config }}

-   deploy: true
    ip_address: 10.30.5.17
    vrf_lite:
    -   dot1q: 20
        interface: Ethernet1/31
        ipv4_addr: 10.5.5.0/31
        ipv6_addr: 2010::10:34:0:0/127
        neighbor_ipv4: 10.5.5.1
        neighbor_ipv6: 2010::10:34:0:1
#      peer_vrf: NEP6DECSP21_to_NEP6DSRJ21_RISE_DMZ
-   deploy: true
    ip_address: 10.30.5.17
    vrf_lite:
    -   dot1q: 20
        interface: Ethernet1/32
        ipv4_addr: 10.5.5.2/31
        ipv6_addr: 2010::10:34:0:2/127
        neighbor_ipv4: 10.5.5.3
        neighbor_ipv6: 2010::10:34:0:3
#      peer_vrf: NEP6DECSP21_to_NEP6DSRJ22_RISE_DMZ
-   deploy: true
    ip_address: 10.30.5.18
    vrf_lite:
    -   dot1q: 20
        interface: Ethernet1/31
        ipv4_addr: 10.5.5.4/31
        ipv6_addr: 2010::10:34:0:4/127
        neighbor_ipv4: 10.5.5.5
        neighbor_ipv6: 2010::10:34:0:5
#      peer_vrf: NEP6DECSP22_to_NEP6DSRJ21_RISE_DMZ
-   deploy: true
    ip_address: 10.30.5.18
    vrf_lite:
    -   dot1q: 20
        interface: Ethernet1/32
        ipv4_addr: 10.5.5.6/31
        ipv6_addr: 2010::10:34:0:6/127
        neighbor_ipv4: 10.5.5.7
        neighbor_ipv6: 2010::10:34:0:7
#      peer_vrf: NEP6DECSP22_to_NEP6DSRJ22_RISE_DMZ```

### Debug Output

<!---
Please provide a link to a GitHub Gist containing the complete debug output. Please do NOT paste the debug output in the issue; just paste a link to the Gist.

To obtain the debug output, use `ansible-playbook -vvv`
--->

### Expected Behavior

In the NDFC GUI, the peer_vrf is optional parameter, there is no red asterisk. Hence the same should be left as optional parameter in Ansible script as well.

![02_17_23](https://user-images.githubusercontent.com/123026397/224101377-7f2982ba-6d1f-4c00-83c7-ec08f8c0ffb1.jpg)

### Actual Behavior

I got this message:

TASK [configure_vrf_lite_test : Merge vrfs] **************************************************************************************************************
fatal: [lab_ndfc_server]: FAILED! => {"changed": false, "msg": "peer_vrf is mandatory under attach VRF LITE parameters"}

Also, the ansible module documentation appears to indicate that the peer_vrf is required parameter.

      attach:
        description:
        - List of vrf attachment details
        type: list
        elements: dict
        suboptions:
          ip_address:
            description:
            - IP address of the switch where vrf will be attached or detached
            type: str
            required: true
            suboptions:
              vrf_lite:
                type: list
                description:
                - VRF Lite Extensions options
                elements: dict
                required: false
                suboptions:
                  peer_vrf:
                    description:
                    - VRF Name to which this extension is attached
                    type: str
                    required: true

### Steps to Reproduce

<!--- Please list the steps required to reproduce the issue. --->

### References

<!---
Information about referencing Github Issues: https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests

Are there any other GitHub issues (open or closed) or pull requests that should be linked here? Vendor documentation? For example:
--->
praveenramoorthy commented 1 year ago

Fixed as part of #219