Guest User

Untitled

a guest
Feb 20th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.34 KB | None | 0 0
  1. cat netapp_test.yml
  2.  
  3. ---
  4. - name: Check version
  5. hosts: localhost
  6. gather_facts: no
  7. connection: local
  8. tasks:
  9. - name: run ontap cli command
  10. na_ontap_command:
  11. hostname: xxhostnamexx
  12. username: netapp_username
  13. password: netapp_password
  14. command: ['version']
  15. ...
  16.  
  17. [root@hostname ansible]# ansible-playbook --check netapp_test.yml -vvv
  18. ansible-playbook 2.7.7
  19. config file = /etc/ansible/ansible.cfg
  20. configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  21. ansible python module location = /usr/lib/python2.7/site-packages/ansible
  22. executable location = /usr/bin/ansible-playbook
  23. python version = 2.7.5 (default, Sep 12 2018, 05:31:16) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
  24. Using /etc/ansible/ansible.cfg as config file
  25. /etc/ansible/hosts did not meet host_list requirements, check plugin documentation if this is unexpected
  26. /etc/ansible/hosts did not meet script requirements, check plugin documentation if this is unexpected
  27. Parsed /etc/ansible/hosts inventory source with ini plugin
  28. /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!
  29. RequestsDependencyWarning)
  30.  
  31. PLAYBOOK: netapp_test.yml *********************************************************************************************************************************************
  32. 1 plays in netapp_test.yml
  33.  
  34. PLAY [Check version] ***************************************************************************************************************************************************
  35. META: ran handlers
  36.  
  37. TASK [run ontap cli command] *******************************************************************************************************************************************
  38. task path: /etc/ansible/netapp_check.yml:12
  39. <127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
  40. <127.0.0.1> EXEC /bin/sh -c 'echo ~root && sleep 0'
  41. <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'
  42. Using module file /usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_command.py
  43. <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
  44. <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'
  45. <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'
  46. <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'
  47. The full traceback is:
  48. Traceback (most recent call last):
  49. File "/tmp/ansible_na_ontap_command_payload_nC0coe/__main__.py", line 83, in run_command
  50. output = self.server.invoke_successfully(command_obj, True)
  51. File "/usr/lib/python2.7/site-packages/netapp_lib/api/zapi/zapi.py", line 281, in invoke_successfully
  52. result = self.invoke_elem(na_element, enable_tunneling)
  53. File "/usr/lib/python2.7/site-packages/netapp_lib/api/zapi/zapi.py", line 261, in invoke_elem
  54. raise NaApiError(e.code, e.msg)
  55. NaApiError: NetApp API failed. Reason - 401:basic auth failed
  56.  
  57. fatal: [localhost]: FAILED! => {
  58. "changed": false,
  59. "invocation": {
  60. "module_args": {
  61. "command": [
  62. "version"
  63. ],
  64. "hostname": "XXX.XX.X.XXX",
  65. "http_port": null,
  66. "https": false,
  67. "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
  68. "username": "admin",
  69. "validate_certs": true
  70. }
  71. },
  72. "msg": "Error running command ['version']: NetApp API failed. Reason - 401:basic auth failed"
  73. }
  74. to retry, use: --limit @/etc/ansible/netapp_check.retry
  75.  
  76. PLAY RECAP *************************************************************************************************************************************************************
  77. localhost : ok=0 changed=0 unreachable=0 failed=1
Add Comment
Please, Sign In to add comment