Software Development Kit (SDK) and API Discussions
Software Development Kit (SDK) and API Discussions
When i initially run my playbook the password change playbook works.
After few run of the playbook, i get the error below. What could be the issue ?
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 - 401:Unauthorized
collections:
- netapp.ontap
Solved! See The Solution
Unauthorized indicates either the username or password is not recognized or user is not authorized for ONTAPI.
I found following kb, but I am not sure if that's applicable to your issue.
To run Ansible modules over https the following lines need to be added to each modules arguments
https: true
validate_certs: false
Unauthorized indicates either the username or password is not recognized or user is not authorized for ONTAPI.
I found following kb, but I am not sure if that's applicable to your issue.
To run Ansible modules over https the following lines need to be added to each modules arguments
https: true
validate_certs: false
I used the following playbook which has the https and validate_certs.
Why it works on first few runs and then it fails with error above ?
- name: Create/Change "{{ username }}" password
netapp.ontap.na_ontap_user:
state: present
name: "{{ username }}"
application_dicts:
- application: http
authentication_methods: password
- application: ontapi
authentication_methods: password
- application: service-processor
authentication_methods: password
- application: ssh
authentication_methods: password
role_name: "{{ role_name }}"
set_password: "{{ new_password }}"
vserver: "{{ cluster }}"
hostname: "{{ inventory_hostname }}"
username: "{{ username }}"
password: "{{ current_password }}"
lock_user: False
https: False
validate_certs: False