Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cat netapp_test.yml
- ---
- - name: Check version
- hosts: localhost
- gather_facts: no
- connection: local
- tasks:
- - name: run ontap cli command
- na_ontap_command:
- hostname: xxhostnamexx
- username: netapp_username
- password: netapp_password
- command: ['version']
- ...
- [root@hostname ansible]# ansible-playbook --check netapp_test.yml -vvv
- ansible-playbook 2.7.7
- config file = /etc/ansible/ansible.cfg
- configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
- ansible python module location = /usr/lib/python2.7/site-packages/ansible
- executable location = /usr/bin/ansible-playbook
- python version = 2.7.5 (default, Sep 12 2018, 05:31:16) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
- Using /etc/ansible/ansible.cfg as config file
- /etc/ansible/hosts did not meet host_list requirements, check plugin documentation if this is unexpected
- /etc/ansible/hosts did not meet script requirements, check plugin documentation if this is unexpected
- Parsed /etc/ansible/hosts inventory source with ini plugin
- /usr/lib/python2.7/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.24.1) or chardet (2.2.1) doesn't match a supported version!
- RequestsDependencyWarning)
- PLAYBOOK: netapp_test.yml *********************************************************************************************************************************************
- 1 plays in netapp_test.yml
- PLAY [Check version] ***************************************************************************************************************************************************
- META: ran handlers
- TASK [run ontap cli command] *******************************************************************************************************************************************
- task path: /etc/ansible/netapp_check.yml:12
- <127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
- <127.0.0.1> EXEC /bin/sh -c 'echo ~root && sleep 0'
- <127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1550659934.55-42808292017672 `" && echo ansible-tmp-1550659934.55-42808292017672="` echo /root/.ansible/tmp/ansible-tmp-1550659934.55-42808292017672 `" ) && sleep 0'
- Using module file /usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_command.py
- <127.0.0.1> PUT /root/.ansible/tmp/ansible-local-883079mH0GE/tmptAYcD0 TO /root/.ansible/tmp/ansible-tmp-1550659934.55-42808292017672/AnsiballZ_na_ontap_command.py
- <127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1550659934.55-42808292017672/ /root/.ansible/tmp/ansible-tmp-1550659934.55-42808292017672/AnsiballZ_na_ontap_command.py && sleep 0'
- <127.0.0.1> EXEC /bin/sh -c '/usr/bin/python2 /root/.ansible/tmp/ansible-tmp-1550659934.55-42808292017672/AnsiballZ_na_ontap_command.py && sleep 0'
- <127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1550659934.55-42808292017672/ > /dev/null 2>&1 && sleep 0'
- The full traceback is:
- Traceback (most recent call last):
- File "/tmp/ansible_na_ontap_command_payload_nC0coe/__main__.py", line 83, in run_command
- output = self.server.invoke_successfully(command_obj, True)
- File "/usr/lib/python2.7/site-packages/netapp_lib/api/zapi/zapi.py", line 281, in invoke_successfully
- result = self.invoke_elem(na_element, enable_tunneling)
- File "/usr/lib/python2.7/site-packages/netapp_lib/api/zapi/zapi.py", line 261, in invoke_elem
- raise NaApiError(e.code, e.msg)
- NaApiError: NetApp API failed. Reason - 401:basic auth failed
- fatal: [localhost]: FAILED! => {
- "changed": false,
- "invocation": {
- "module_args": {
- "command": [
- "version"
- ],
- "hostname": "XXX.XX.X.XXX",
- "http_port": null,
- "https": false,
- "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
- "username": "admin",
- "validate_certs": true
- }
- },
- "msg": "Error running command ['version']: NetApp API failed. Reason - 401:basic auth failed"
- }
- to retry, use: --limit @/etc/ansible/netapp_check.retry
- PLAY RECAP *************************************************************************************************************************************************************
- localhost : ok=0 changed=0 unreachable=0 failed=1
Add Comment
Please, Sign In to add comment