Couldn't resolve module/action 'netapp.ontap.na_ontap_rest_info'

I am attempting to run my Ansible playbook against my NetApp cluster, and I receive the following error shown below.

I have met all of the requirements for installing netapp.ontap collections.

What am I missing here? The .yml file looks more than fine and is spelled correctly. I have tried reinstalling “ansible-galaxy collection install netapp.ontap” several times but with no luck.

ERROR! couldn't resolve module/action 'netapp.ontap.na_ontap_rest_info'. This often indicates a misspelling, missing collection, or incorrect module path.

The error appears to be in '/runner/project/Test-Connectivity.yml': line 20, column 7, but may be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: Collect ONTAP Info
^ here

> $ ansible --version
> ansible [core 2.14.9]
>   config file = /etc/ansible/ansible.cfg
>   configured module search path = ['/home/admin/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
>   ansible python module location = /usr/lib/python3.9/site-packages/ansible
>   ansible collection location = /home/admin/.ansible/collections:/usr/share/ansible/collections
>   executable location = /usr/bin/ansible
>   python version = 3.9.18 (main, Sep  7 2023, 00:00:00) [GCC 11.4.1 20230605 (Red Hat 11.4.1-2)] (/usr/bin/python3)
>   jinja version = 3.1.2
>   libyaml = True
> $ ansible-galaxy collection list
> # /home/admin/.ansible/collections/ansible_collections
> Collection         Version
> ------------------ -------
> cloud.common       3.0.0
> community.vmware   4.0.1
> netapp.ontap       22.9.0
> vmware.vmware_rest 3.0.0
> MARS40-CLUSTER::> version
> NetApp Release 9.12.1: Tue Jan 31 19:19:43 UTC 2023

  • hosts: localhost
    gather_facts: false
    name: Connectivity Test & Display ONTAP Info


    • name: Test Connectivity
      url: “https://{{ netapp_hostname }}”
      method: GET
      validate_certs: false
      return_content: no
      register: response

    • name: Print Connectivity Test Result
      msg: “Connectivity test passed with status code: {{ response.status }}”
      when: response.status == 200

    • name: Collect ONTAP Info
      hostname: “{{ netapp_hostname }}”
      username: “{{ netapp_username }}”
      password: “{{ netapp_password }}”
      validate_certs: false
      gather_subsets: “svm/svms”
      register: ontap_info

    • name: Print ONTAP Response
      msg: “{{ ontap_info }}”

@marshit Hello.

How did you run the playbook?

For example, ansible-playbook, ansible-navigator, AWX, Automation Controller, etc.

I think the environment in which you installed the collection and the environment in which you run Playbook may be different.

1 Like

@akira6592 Hello, so I’m going to try my best to explain this (LOL)…So, I only run playbooks by way of AWX.

I installed AWX using K3s, so I have running pods.

> [admin@RHEL9-AWX ~]$ kubectl get pods -n awx
> NAME                                               READY   STATUS    RESTARTS         AGE
> awx-postgres-13-0                                  1/1     Running   8 (4h15m ago)    177d
> awx-task-9b46bf5fd-wp768                           4/4     Running   32 (4h15m ago)   177d
> awx-web-7c9cc95f8b-bkp6r                           3/3     Running   24 (4h15m ago)   177d
> awx-operator-controller-manager-6c58d59d97-27qt2   2/2     Running   47 (4h14m ago)   177d

That being said, I didn’t do anything special about installing, as you can see from my command, and yes, maybe that’s the issue, but I wasn’t sure how or what differently I needed to do.

But I only use the default ‘AWX-EE’ environment within AWX.

@akira6592 Since you brought it up, do you mean I need to do something like this - “ansible-galaxy collection install --environment awx-ee <collection_name>”.

Does that look to be what you mean?

I will try that and update the ticket. Sometimes, I just need a little help : )


But I only use the default ‘AWX-EE’ environment within AWX.

Thanks for the information.

AWX-EE refers to This image does not have the netapp.ontap collection.

So you need to include the netapp.ontap collection in your Execution environment.

There are two ways to do this.

1. Create a custom image

You can use ansible-builder to build a custom image containing the netapp.ontap collection.

  • Build a custom image includes netapp.ontap collection.
  • Push the custom image
  • Define it as an Execution Environment on AWX
  • Configure the job template to run the job using the new (custom) Execution Environment

2. Include collections/requirements.yml in the project

If you have difficulty building custom images, this may be a good option.

Create a file called collections/requirements.yml in the project containing the Playbook with the following contents.

  - name: netapp.ontap

This will automatically install the netapp.ontap collection when the job template is started.


@akira6592 I’ll try this and get back to you with an update later today.

@akira6592 I created a requirements.yml file and added it to the root of my GitHub repository.

- netapp.cloudmanager           
- netapp.elementsw               
- netapp.ontap                  
- netapp.storagegrid            
- netapp.um_info                 
- netapp_eseries.santricity       
- netbox.netbox

Thank you very much for your help!

1 Like

My pleasure :grinning:
If it worked, could you mark my post as a solution?

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.