# Error: the python NetApp-Lib module is required

**URL:** <https://forum.ansible.com/t/error-the-python-netapp-lib-module-is-required/3439>\
**Category:** Get Help\
**Tags:** ansible, playbook, awx\
**Created:** [January 23, 2024, 5:13am UTC](https://forum.ansible.com/t/error-the-python-netapp-lib-module-is-required/3439 "2024-01-23T05:13:04Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![marshit](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@marshit](https://forum.ansible.com/u/marshit)\
**Post date:** [January 23, 2024, 5:13am UTC](https://forum.ansible.com/t/error-the-python-netapp-lib-module-is-required/3439/1 "2024-01-23T05:13:04Z")

</div>

I’m trying to run a playbook against a NetApp cluster. I have all of the collections installed with a requirements.yml file.

I have created a requirements.txt file in order to install the ‘netapp-lib’ python library. Then, within the template for the job, I added a variable:

```auto
---
ansible_python_interpreter: "/usr/bin/env python"

```

This is the error returned when trying to run the playbook and for the job to install the Python library ‘netapp-lib’.

```auto
**value(s) in REST: ['root_volume', 'root_volume_aggregate',**

15

**'root_volume_security_style']**

16

fatal: [localhost]: FAILED! => {"changed": false, "msg": "Error: the python NetApp-Lib module is required. Import error: No module named 'netapp_lib'"}

```

Looking at ansible docs the ‘root\_volume\_security\_style’ is correct, so I can only assume I’m receiving that error because the Python module is noe installing. I’m doing this all from within AWX.

Here is the playbook information:

```auto
---
- hosts: localhost
  gather_facts: false
  name: NetApp SVM Setup
  vars_files:
  - variables-1.yml

  tasks:
  - name: Define login
    set_fact:
      login:
        hostname: "{{ clusterip }}"
        username: "{{ user }}"
        password: "{{ pass }}"
        validate_certs: "{{ validate_certs_option }}"

  - name: Create SVM
    na_ontap_svm:
      state: present
      name: "{{ svmname }}"
      root_volume: "{{ rootvolname }}"
      root_volume_aggregate: "{{ rootvolaggr }}"
      root_volume_security_style: "{{ rootvolsecurity }}"
      aggr_list: "{{ allowedaggrs }}"
      allowed_protocols: "{{ allowedprotocols }}"
      hostname: "{{ clusterip }}"
      username: "{{ user }}"
      password: "{{ pass }}"
      validate_certs: "{{ validate_certs_option }}"

  - name: Start NFS
    na_ontap_nfs:
      state: present
      service_state: started
      vserver: "{{ svmname }}"
      nfsv3: enabled
      hostname: "{{ clusterip }}"
      username: "{{ user }}"
      password: "{{ pass }}"
      validate_certs: "{{ validate_certs_option }}"
      

  - name: Create NFS Export Rule Under Default Policy
    na_ontap_export_policy_rule:
      state: present
      name: default
      vserver: "{{ svmname }}"
      client_match: "{{ nfsclientmatchsubnet }}"
      ro_rule: sys
      rw_rule: sys
      protocol: nfs
      super_user_security: any
      hostname: "{{ clusterip }}"
      username: "{{ user }}"
      password: "{{ pass }}"
      validate_certs: "{{ validate_certs _option }}"
  - debug: msg="{{ svmname }} has been created along with 1 NFS volume called {{ nfsvolname1 }}"

```

---

<div class="post-metadata">

**Author:** ![thedoubl3j](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/thedoubl3j/32/103_2.png) [@thedoubl3j](https://forum.ansible.com/u/thedoubl3j)\
**Post date:** [January 23, 2024, 4:23pm UTC](https://forum.ansible.com/t/error-the-python-netapp-lib-module-is-required/3439/2 "2024-01-23T16:23:59Z")

</div>

Hey @marshit the netapp collection is not included in the default EE for awx so you will need to build your own with [ansible-builder](https://ansible.readthedocs.io/projects/builder/en/latest/) and then use that EE for this job template/project. You can find docs on how to get the EE into AWX [here](https://ansible.readthedocs.io/projects/awx/en/latest/userguide/execution_environments.html#execution-environments).

---

<div class="post-metadata">

**Author:** ![acozine](https://avatars.discourse-cdn.com/v4/letter/a/ecccb3/32.png) [@acozine](https://forum.ansible.com/u/acozine)\
**Post date:** [January 23, 2024, 4:45pm UTC](https://forum.ansible.com/t/error-the-python-netapp-lib-module-is-required/3439/3 "2024-01-23T16:45:05Z")

</div>

IIRC you can load collections from Galaxy into the default Execution Environment at runtime - the file that defines your collection dependencies must be formatted in YAML, named `requirements.yml` and saved in the `collections/` directory of your repo. Making a custom EE is definitely more efficient, though.

---

<div class="post-metadata">

**Author:** ![acozine](https://avatars.discourse-cdn.com/v4/letter/a/ecccb3/32.png) [@acozine](https://forum.ansible.com/u/acozine)\
**Post date:** [January 23, 2024, 4:51pm UTC](https://forum.ansible.com/t/error-the-python-netapp-lib-module-is-required/3439/4 "2024-01-23T16:51:48Z")

</div>

Oh, reading your post more closely, you’re not seeing missing Ansible modules, but a missing Python module. Sorry I misunderstood.

---

<div class="post-metadata">

**Author:** ![acozine](https://avatars.discourse-cdn.com/v4/letter/a/ecccb3/32.png) [@acozine](https://forum.ansible.com/u/acozine)\
**Post date:** [January 23, 2024, 4:55pm UTC](https://forum.ansible.com/t/error-the-python-netapp-lib-module-is-required/3439/5 "2024-01-23T16:55:29Z")

</div>

You should be able to install a python package from your playbook with a task or pre-task:

```auto
- name: Install NetApp-Lib python package
  ansible.builtin.pip:
    name: NetApp-Lib

```

Docs: [ansible.builtin.pip module – Manages Python library dependencies — Ansible Documentation](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/pip_module.html)

---

<div class="post-metadata">

**Author:** ![marshit](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@marshit](https://forum.ansible.com/u/marshit)\
**Post date:** [January 23, 2024, 4:59pm UTC](https://forum.ansible.com/t/error-the-python-netapp-lib-module-is-required/3439/6 "2024-01-23T16:59:06Z")

</div>

I think what I’m finding is that an execution environment is the way to go for this NetApp stuff, sadly. If that doesn’t work, then @acozine I will try your step.

I’m going to try the execution environment first and update this post.

---

<div class="post-metadata">

**Author:** ![marshit](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@marshit](https://forum.ansible.com/u/marshit)\
**Post date:** [January 23, 2024, 8:11pm UTC](https://forum.ansible.com/t/error-the-python-netapp-lib-module-is-required/3439/7 "2024-01-23T20:11:18Z")

</div>

@acozine I tried your steps, but I was told I had missing Python dependencies when trying to run my playbook. Then I proceeded to try creating an execution environment. I’m using Podman for the EE.

I have my file on my local AWX host:

bindep.txt  
requirements.txt  
requirements.yml  
execution-environment.yml

I got them from here - [GitHub - schmots1/na-ansible-ee: Files for building a NetApp computable Ansible Execution Enviornment](https://github.com/schmots1/na-ansible-ee.git)

Ran the commands:

> pip3 install ansible-builder build
> 
> ansible-builder build --container-runtime=podman --tag [myregistry.io/ansible-ee-netapp](http://myregistry.io/ansible-ee-netapp) -f execution-environment.yml -v 3

I receive the following error below:

> → 944c522e0fa  
> [2/4] STEP 12/12: RUN ANSIBLE\_GALAXY\_DISABLE\_GPG\_VERIFY=1 ansible-galaxy collection install $ANSIBLE\_GALAXY\_CLI\_COLLECTION\_OPTS -r requirements.ym l --collections-path “/usr/share/ansible/collections”  
> Starting galaxy collection install process  
> Process install dependency map  
> [WARNING]: Skipping Galaxy server [Api Root – Pulp 3](https://galaxy.ansible.com/api/). Got an  
> unexpected error when getting available versions of collection  
> community.general: ‘/api/v3/plugin/ansible/content/published/collections/index/  
> community/general/versions/’  
> ERROR! Unexpected Exception, this is probably a bug: ‘/api/v3/plugin/ansible/content/published/collections/index/community/general/versions/’  
> to see the full traceback, use -vvv  
> Error: building at STEP “RUN ANSIBLE\_GALAXY\_DISABLE\_GPG\_VERIFY=1 ansible-galaxy collection install $ANSIBLE\_GALAXY\_CLI\_COLLECTION\_OPTS -r requirem ents.yml --collections-path “/usr/share/ansible/collections””: while running runtime: exit status 250

---

<div class="post-metadata">

**Author:** ![marshit](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@marshit](https://forum.ansible.com/u/marshit)\
**Post date:** [January 23, 2024, 11:22pm UTC](https://forum.ansible.com/t/error-the-python-netapp-lib-module-is-required/3439/8 "2024-01-23T23:22:53Z")

</div>

I’m basically being told that none of the collections within my requirements.yml file has a requiremetns.txt file.

As you can see, they all do, although they are blank, but that should be fine.

```auto
/home/admin/.ansible/collections/ansible_collections/amazon/aws/requirements.txt
/home/admin/.ansible/collections/ansible_collections/amazon/aws/test-requirements.txt
/home/admin/.ansible/collections/ansible_collections/amazon/aws/tests/integration/requirements.txt
/home/admin/.ansible/collections/ansible_collections/amazon/aws/tests/unit/requirements.txt
/home/admin/.ansible/collections/ansible_collections/ansible/posix/requirements.txt
/home/admin/.ansible/collections/ansible_collections/ansible/posix/test-requirements.txt
/home/admin/.ansible/collections/ansible_collections/ansible/posix/tests/unit/requirements.txt
/home/admin/.ansible/collections/ansible_collections/cloud/common/requirements.txt
/home/admin/.ansible/collections/ansible_collections/cloud/common/test-requirements.txt
/home/admin/.ansible/collections/ansible_collections/cloud/common/tests/unit/requirements.txt
/home/admin/.ansible/collections/ansible_collections/community/general/tests/unit/requirements.txt
/home/admin/.ansible/collections/ansible_collections/community/vmware/requirements.txt
/home/admin/.ansible/collections/ansible_collections/community/vmware/test-requirements.txt
/home/admin/.ansible/collections/ansible_collections/community/vmware/tests/unit/requirements.txt
/home/admin/.ansible/collections/ansible_collections/netapp/aws/requirements.txt
/home/admin/.ansible/collections/ansible_collections/netapp/aws/tests/unit/requirements.txt
/home/admin/.ansible/collections/ansible_collections/netapp/azure/requirements.txt
/home/admin/.ansible/collections/ansible_collections/netapp/azure/tests/unit/requirements.txt
/home/admin/.ansible/collections/ansible_collections/netapp/elementsw/requirements.txt
/home/admin/.ansible/collections/ansible_collections/netapp/elementsw/tests/unit/requirements.txt
/home/admin/.ansible/collections/ansible_collections/netapp/ontap/requirements.txt
/home/admin/.ansible/collections/ansible_collections/netapp/ontap/execution_environments/requirements.txt
/home/admin/.ansible/collections/ansible_collections/netapp/ontap/tests/unit/requirements.txt
/home/admin/.ansible/collections/ansible_collections/netapp/storagegrid/requirements.txt
/home/admin/.ansible/collections/ansible_collections/netapp/storagegrid/tests/unit/requirements.txt
/home/admin/.ansible/collections/ansible_collections/netapp/um_info/requirements.txt
/home/admin/.ansible/collections/ansible_collections/netapp/um_info/tests/unit/requirements.txt
/home/admin/.ansible/collections/ansible_collections/vmware/vmware_rest/docs-requirements.txt
/home/admin/.ansible/collections/ansible_collections/vmware/vmware_rest/requirements.txt
/home/admin/.ansible/collections/ansible_collections/vmware/vmware_rest/test-requirements.txt

```

```auto
collections:
- name: netapp.aws
- name: netapp.azure
- name: netapp.cloudmanager
- name: netapp.elementsw
- name: netapp.ontap
- name: netapp.storagegrid
- name: netapp.um_info
- name: netapp_eseries.santricity

```

So, I’m at a loss as to why this is happening.

---

<div class="post-metadata">

**Author:** ![thedoubl3j](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/thedoubl3j/32/103_2.png) [@thedoubl3j](https://forum.ansible.com/u/thedoubl3j)\
**Post date:** [January 29, 2024, 7:30pm UTC](https://forum.ansible.com/t/error-the-python-netapp-lib-module-is-required/3439/9 "2024-01-29T19:30:26Z")

</div>

that galaxy error is interesting. are you able to pull down collections with just `ansible-galaxy collection install some.collection`?

I will see if I can find time to build an EE and give things a test.

---

<div class="post-metadata">

**Author:** ![marshit](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@marshit](https://forum.ansible.com/u/marshit)\
**Post date:** [January 29, 2024, 9:29pm UTC](https://forum.ansible.com/t/error-the-python-netapp-lib-module-is-required/3439/10 "2024-01-29T21:29:08Z")

</div>

@thedoubl3j yes, individually they seem to work fine, but yet, even then, when in AWX I still can’t get anything NetApp related to work for projects.

As if the collections still didn’t install.

Makes me think how is this better than just using Python LOL

But thanks for the help if you get a chance. Sometime I feel like it was my internet, but I can curl just fine to some of the individual collection websites.

---

<div class="post-metadata">

**Author:** ![marshit](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@marshit](https://forum.ansible.com/u/marshit)\
**Post date:** [January 31, 2024, 1:16am UTC](https://forum.ansible.com/t/error-the-python-netapp-lib-module-is-required/3439/11 "2024-01-31T01:16:03Z")

</div>

By far these are the best set (and only) instructions I found that worked to install an EE environment.

> **[How to create execution environments using ansible-builder | Red Hat Developer](https://developers.redhat.com/articles/2023/05/08/how-create-execution-environments-using-ansible-builder#)**
>
> Learn how to use execution environment builder, a CLI tool for Ansible Automation Platform, to create custom images and push them to a private automation hub.

I’m good now, this ticket is done.

---

<div class="post-metadata">

**Author:** ![marshit](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@marshit](https://forum.ansible.com/u/marshit)\
**Post date:** [February 2, 2024, 12:12am UTC](https://forum.ansible.com/t/error-the-python-netapp-lib-module-is-required/3439/12 "2024-02-02T00:12:56Z")

</div>

So by following the article above, I was able to get my execution environment setup and running. The problem now is that when I try to gather inventory, which works when I use the default AWX EE, I get no joy.

```auto
Receptor detail:
Error creating pod: container failed to start, ImagePullBackOff

```

When I run “podman images” I get the following:

```auto

```

```auto
REPOSITORY TAG IMAGE ID CREATED SIZE
localhost/custom-ee latest bfe6c40bad52 21 seconds ago 626 MB

`quay.io/ansible/ansible-runner`

```

```auto

```

 ![image](https://us1.discourse-cdn.com/ansible/original/2X/5/5eedbc345373276f76becb7e62e5c8bf31d85810.png)

What could be causing the problem or how to troubleshoot the image pull failure?

---

<div class="post-metadata">

**Author:** ![marshit](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@marshit](https://forum.ansible.com/u/marshit)\
**Post date:** [February 3, 2024, 6:36am UTC](https://forum.ansible.com/t/error-the-python-netapp-lib-module-is-required/3439/13 "2024-02-03T06:36:10Z")

</div>

I was able to finally get my [quay.io](http://quay.io) account is finally working properly. So this post, I would say, is resolved.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [March 4, 2024, 6:36am UTC](https://forum.ansible.com/t/error-the-python-netapp-lib-module-is-required/3439/14 "2024-03-04T06:36:49Z")

</div>

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