CiscoDevNet / ansible-dcnm

Apache License 2.0
45 stars 36 forks source link

dcnm_link error when trying to modify the auto-discovered link #236

Closed dsx1123 closed 9 months ago

dsx1123 commented 1 year ago

Community Note

Ansible Version and collection version

ansible [core 2.12.6]
  config file = /home/shdu/.ansible.cfg
  configured module search path = ['/home/shdu/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/shdu/virtualenv/ansible/lib/python3.11/site-packages/ansible
  ansible collection location = /home/shdu/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/shdu/virtualenv/ansible/bin/ansible
  python version = 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0]
  jinja version = 3.1.2
  libyaml = True

DCNM version

Affected module(s)

Ansible Playbook

# Copy-paste your anisble playbook here 
   - name: modify links between leaf and spine
      cisco.dcnm.dcnm_links:
        src_fabric: "{{ fabric.name }}"
        config:
          - dst_fabric: "{{ fabric.name }}"
            src_device: "{{ fabric.leaf[0] }}"
            dst_device: "{{ fabric.spine[0] }}"
            src_interface: "Ethernet1/5"
            dst_interface: "Ethernet1/1"
            template: int_intra_fabric_num_link
            profile:
              peer1_ipv4_addr: 10.30.1.1
              peer2_ipv4_addr: 10.30.1.2
              peer1_ipv6_addr: ""
              peer2_ipv6_addr: ""
              admin_state: true
              mtu: 9216

Debug Output

https://gist.github.com/dsx1123/764737ed309378de23f41bb0e6ae62c8

Expected Behavior

Actual Behavior

Steps to Reproduce

this link is auto-discovered during adding switches. so the template name is empty which cause the bug.

References

dsx1123 commented 1 year ago

@mmudigon could you please take a look?

mmudigon commented 1 year ago

Hi Shangxin,

What's the issue here? I see that you mentioned that this is an auto discovered link and so ‘template’ is empty. But the sample playbook you included has the ‘template’ filled up properly. ‘template’ is a mandatory argument for links, without which it will error out. Let me know if you feel otherwise and what the use case is. Will try to see if we can handle this.

Thanks

Regards Mallik

From: Shangxin Du @.> Date: Tuesday, 1 August 2023 at 07:07 To: CiscoDevNet/ansible-dcnm @.> Cc: MALLIK MUDIGONDA (mmudigon) @.>, Mention @.> Subject: Re: [CiscoDevNet/ansible-dcnm] dcnm_link error when trying to modify the auto-discovered link (Issue #236)

@mmudigonhttps://github.com/mmudigon could you please take a look?

— Reply to this email directly, view it on GitHubhttps://github.com/CiscoDevNet/ansible-dcnm/issues/236#issuecomment-1659434398, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AO62E6LD2YCF3TDXYTTXTD3XTBMTZANCNFSM6AAAAAA27BDH5Q. You are receiving this because you were mentioned.Message ID: @.***>

mikewiebe commented 9 months ago

Resolved with https://github.com/CiscoDevNet/ansible-dcnm/pull/253