CiscoDevNet / ansible-dcnm

Apache License 2.0
47 stars 37 forks source link

Error on Auth with NDFC #157

Closed lwy119 closed 1 year ago

lwy119 commented 2 years ago

Community Note

Ansible Version and collection version

2.11.0

DCNM version

Affected module(s)

Ansible Playbook

---

- hosts: dcnm_controllers
  gather_facts: false
  connection: ansible.netcommon.httpapi

  collections:
    - cisco.dcnm

  tasks:
    - name: Query Test
      cisco.dcnm.dcnm_interface:
        fabric: fabric
        state: query
        config:
          - switch:
            - "10.1.1.1"

Debug Output

https://gist.github.com/lwy119/e72960dcda164fb34566dc13d8d511c7

Expected Behavior

Successfully login and perform the query task

Actual Behavior

Failed at login step

Steps to Reproduce

ansible-play -i host query.yml

References

praveenramoorthy commented 2 years ago

@lwy119, thanks for raising the issue. Can you please let me know the DCNM collection version which you are using? Can you try with the latest 2.1.0 collection release? This issue has been fixed in that version.

lwy119 commented 2 years ago

@praveenramoorthy thanks for the reply. Turns out I had a typo in host file. After fixing that the authentication works fine.

However I have another issue. After I created some policies through Ansible, I can see the CLI are pushed to the switches. When I do recalculate and deploy in NDFC, it shows the switches are not in sync and there are pending configs. If I look into what configs are pending, it basically removes my pushed config and adds them back once….any workaround on this? Is this an expected behavior? It seems NDFC does not recognize configs pushed via Ansible?

dsx1123 commented 2 years ago

@lwy119 the configuration pushed from policy need match the cli format, especially when you are using freeform template, do you mind share you your playbook here?

mikewiebe commented 1 year ago

Fixed in release https://github.com/CiscoDevNet/ansible-dcnm/releases/tag/3.0.0