Software Development Kit (SDK) and API Discussions

user password change playbook not working after few runs

Thiepaan
340 Views

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

 

2 REPLIES 2

Ontapforrum
327 Views

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.

 

https://kb.netapp.com/Advice_and_Troubleshooting/Data_Storage_Software/ONTAP_OS/Ansible_is_not_able_to_connect_to_ONTAP

 

To run Ansible modules over https the following lines need to be added to each modules arguments
https: true
validate_certs: false

 

Thiepaan
309 Views

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

Public