# Cisco NDFC Ansible collection

**URL:** <https://forum.ansible.com/t/cisco-ndfc-ansible-collection/9706>\
**Category:** Get Help\
**Tags:** collections\
**Created:** [October 5, 2024, 6:11pm UTC](https://forum.ansible.com/t/cisco-ndfc-ansible-collection/9706 "2024-10-05T18:11:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![selvigp](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/selvigp/32/4977_2.png) [@selvigp](https://forum.ansible.com/u/selvigp)\
**Post date:** [October 5, 2024, 6:11pm UTC](https://forum.ansible.com/t/cisco-ndfc-ansible-collection/9706/1 "2024-10-05T18:11:41Z")

</div>

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:

```auto
---
- 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:

```auto
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": ""
}

```

---

<div class="post-metadata">

**Author:** ![jiholland](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jiholland/32/11273_2.png) [@jiholland](https://forum.ansible.com/u/jiholland)\
**Post date:** [October 5, 2024, 6:19pm UTC](https://forum.ansible.com/t/cisco-ndfc-ansible-collection/9706/2 "2024-10-05T18:19:38Z")

</div>

```yaml
$ ansible-galaxy collection install ansible.utils

```

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [October 5, 2024, 6:45pm UTC](https://forum.ansible.com/t/cisco-ndfc-ansible-collection/9706/3 "2024-10-05T18:45:28Z")

</div>

Which should automatically happen if you install `ansible.netcommon`, since that depends on `ansible.utils` ([ansible.netcommon/galaxy.yml at v7.1.0 · ansible-collections/ansible.netcommon · GitHub](https://github.com/ansible-collections/ansible.netcommon/blob/v7.1.0/galaxy.yml#L5)). How did you install the collections?

---

<div class="post-metadata">

**Author:** ![selvigp](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/selvigp/32/4977_2.png) [@selvigp](https://forum.ansible.com/u/selvigp)\
**Post date:** [October 6, 2024, 10:20am UTC](https://forum.ansible.com/t/cisco-ndfc-ansible-collection/9706/4 "2024-10-06T10:20:52Z")

</div>

I have downloaded tar files from ansible-galaxy for ansible.netcommon packages and installed it.

---

<div class="post-metadata">

**Author:** ![jiholland](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jiholland/32/11273_2.png) [@jiholland](https://forum.ansible.com/u/jiholland)\
**Post date:** [October 6, 2024, 1:00pm UTC](https://forum.ansible.com/t/cisco-ndfc-ansible-collection/9706/5 "2024-10-06T13:00:27Z")

</div>

Ok, that makes sense. If you are in an air-gapped environment or cannot access [galaxy.ansible.com](http://galaxy.ansible.com), you must download and install [ansible.utils](https://galaxy.ansible.com/ui/repo/published/ansible/utils/) too.

---

<div class="post-metadata">

**Author:** ![selvigp](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/selvigp/32/4977_2.png) [@selvigp](https://forum.ansible.com/u/selvigp)\
**Post date:** [October 6, 2024, 3:56pm UTC](https://forum.ansible.com/t/cisco-ndfc-ansible-collection/9706/6 "2024-10-06T15:56:00Z")

</div>

Ok fine, thanks for your reply. Let me check it
