Hi, I am trying to collect switch configuration details from Cisco NDFC controller. I have installed ansible collection with cisco.dcnm = 3.5.1
, ansible.netcommon = 7.1.0
. Ansible version = 2.14.14
.
Ansible_script:
---
- name: Collect switch configuration from Cisco NDFC using cisco.dcnm
hosts: localhost
connection: network_cli
gather_facts: no
collections:
- cisco.dcnm
tasks:
- name: Get inventory of switches from NDFC fabric
cisco.dcnm.dcnm_inventory:
src: inventory
state: merged
fabric: "{{ fabric_name }}"
host: "{{ ndfc_host }}"
auth_token: "{{ api_key }}"
validate_certs: "{{ verify_ssl }}"
register: switch_inventory
- name: Display switch inventory
debug:
msg: "{{ switch_inventory }}"
- name: Save switch inventory to a file
copy:
content: "{{ switch_inventory | to_nice_json }}"
dest: "/tmp/switch_inventory.json"
Error:
ModuleNotFoundError: No module named 'ansible_collections.ansible.utils'
fatal: [localhost]: FAILED! => {
"msg": "Unexpected failure during module execution: No module named 'ansible_collections.ansible.utils'",
"stdout": ""
}