Subscribe

New ansible setup issues with NetApp-Lib module

Greetings,

 

I am setting up ansbile on a mac image.

 

I have successfully run ping and version commands from ansible. 

 

 

However, running into this message in a simple ansible play with the NetApp module.

 

 "msg": "the python NetApp-Lib module is required"

 

I initially thought this might be a path issue however it does not appear to be. I am thinking I may need some additional configurations in my /etc/ansible/ansible.cfg

 

 

Here is the output from ansible command

 

-----

TASK [Create Volume] **************************************************************************************************************************************************
task path: /Users/DarthVador/Documents/ansible/Create_ntap_vol.yml:17
Using module file /Users/DarthVador/Library/Python/2.7/lib/python/site-packages/ansible/modules/storage/netapp/na_cdot_volume.py
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: DarthVador
<127.0.0.1> EXEC /bin/sh -c 'echo ~ && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /Users/DarthVador/.ansible/tmp/ansible-tmp-1507666982.92-179025723865433 `" && echo ansible-tmp-1507666982.92-179025723865433="` echo /Users/DarthVador/.ansible/tmp/ansible-tmp-1507666982.92-179025723865433 `" ) && sleep 0'
<127.0.0.1> PUT /var/folders/14/6yd6s2g92t76jlv24twm_fs00000gn/T/tmpHcJkWM TO /Users/DarthVador/.ansible/tmp/ansible-tmp-1507666982.92-179025723865433/na_cdot_volume.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /Users/DarthVador/.ansible/tmp/ansible-tmp-1507666982.92-179025723865433/ /Users/DarthVador/.ansible/tmp/ansible-tmp-1507666982.92-179025723865433/na_cdot_volume.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python /Users/DarthVador/.ansible/tmp/ansible-tmp-1507666982.92-179025723865433/na_cdot_volume.py; rm -rf "/Users/DarthVador/.ansible/tmp/ansible-tmp-1507666982.92-179025723865433/" > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
"changed": false,
"failed": true,
"invocation": {
"module_args": {
"aggregate_name": "aggr1",
"hostname": "Cluster1",
"infinite": false,
"is_infinite": false,
"is_online": true,
"name": "ansibleVolume",
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"size": 29,
"size_unit": "mb",
"state": "present",
"username": "admin",
"vserver": "MyVserver"
}
},
"msg": "the python NetApp-Lib module is required"
}
to retry, use: --limit @/Users/DarthVador/Documents/ansible/Create_ntap_vol.retry

PLAY RECAP ************************************************************************************************************************************************************
localhost : ok=0 changed=0 unreachable=0 failed=1

----------------------

 

 

 Thanks for any help you can offer!

 

 

Re: New ansible setup issues with NetApp-Lib module

[ Edited ]

you just need to install the python Netapp-Lib module on your Mac - "pip install netapp-lib"

 

Here are the general setup instructions we use for the Ansible Netapp modules....

 

DEPENDENCIES

  • Python 2.7 or newer is installed (older version probably work)
  • Ansible 2.4 or newer (contains all of the extra modules including storage)
  • Netapp Lib module is installed - pip install netapp-lib
  • Install a YAML linter in ATOM (optional)
  • The netapp modules use port 80 (it is hard coded in their modules) so you need to enable port 80 on the storage device

 

Check for missing dependencies in Python for the Netapp modules by running the following commands…

 

  • python -c "from netapp_lib.api.zapi import zapi" && echo $?
  • python -c "from netapp_lib.api.zapi import errors" && echo $?

 

Re: New ansible setup issues with NetApp-Lib module

Hey Thanks for the reply

 

The netapp module was installed

 

python -c "from netapp_lib.api.zapi import zapi" && echo $?

 

This command helped me find that I was missing 2 packages in my install the  lxml and oslo_log

 

pip install lxml

pip install oslo_log --ignore-installed