Software Development Kit (SDK) and API Discussions

Unexpected error with Ansible connecting to Ontap 9.3

matthias_beck
11,635 Views

Hello together,

 

I try to get Ansible running against a cDOT 9.3 system.

 

ansible 2.5.3
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 = /bin/ansible
python version = 2.7.5 (default, Aug 4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]

 

I have cloned the git repository and copied the files to the appropriate path.

 

Playbook:

---

- name: NetApp Test
  hosts: localhost
  connection: local

  vars:
      netapp_username: admin
      netapp_cluster: FQDN of cluster

  vars_prompt:
  - name: "netapp_password"
    prompt: "Password"

# Create standard roles on NetApp cDot systems
  tasks:
    - name: User_Role_Manager
      na_ontap_user_role:
        state: present
        name: NetAppAdminSupp
        command_directory_name: DEFAULT
        access_level: readonly
        https: yes
        vserver: " {{ netapp_cluster }}"
        hostname: "{{ netapp_cluster }}"
        username: "{{ netapp_username }}"
        password: "{{ netapp_password }}"

When I run this playbook, I get the following unexpected error:

 

ansible-playbook role_test.yml
Password:

PLAY [NetApp Test] ******************************************************************************************************************************************

TASK [Gathering Facts] **************************************************************************************************************************************
ok: [localhost]

TASK [User_Role_Manager] ************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: netapp_lib.api.zapi.zapi.NaApiError: NetApp API failed. Reason - Unexpected error:
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_0ZJewB/ansible_module_na_ontap_user_role.py\", line 209, in <module>\n    main()\n  File \"/tmp/ansible_0ZJewB/ansible_module_na_ontap_user_role.py\", line 206, in main\n    v.apply()\n  File \"/tmp/ansible_0ZJewB/ansible_module_na_ontap_user_role.py\", line 185, in apply\n    netapp_utils.ems_log_event(\"na_ontap_user_role\", self.server)\n  File \"/tmp/ansible_0ZJewB/ansible_modlib.zip/ansible/module_utils/netapp.py\", line 205, in ems_log_event\n  File \"/usr/lib/python2.7/site-packages/netapp_lib/api/zapi/zapi.py\", line 282, in invoke_successfully\n    result = self.invoke_elem(na_element, enable_tunneling)\n  File \"/usr/lib/python2.7/site-packages/netapp_lib/api/zapi/zapi.py\", line 264, in invoke_elem\n    raise NaApiError('Unexpected error', e.message)\nnetapp_lib.api.zapi.zapi.NaApiError: NetApp API failed. Reason - Unexpected error:\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 1}
        to retry, use: --limit @/git/role_test.retry

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

Does anyone have an idea?

 

Regards

Matthias

13 REPLIES 13
Public