Closed fostermi closed 1 year ago
After further investigation, I'm not sure if the title and description are entirely accurate. I get this error, but I'm not sure when the error is being returned. I now believe it happens when the module attempts to check on the status of the request after it is sent by the rest api module, because the task sits and waits for several seconds before completing.
After some more digging, I think this is because the module attempts to check the status of the job by querying the API endpoint /api/cluster/jobs
, which I don't have permissions to do on our vserver. Is there a way around this?
Closing this as I think its not relevant now that I know access to the /cluster/jobs
endpoint is needed.
Ya, Access to /cluster/jobs is needed by most API. Any REST API that is Async or takes some time to complete will return successful (regardless if it worked or not) with a Job. We then monitor that Job which will tell us if it complete or if there was an error.
Summary
The
netapp.ontap.na_ontap_rest_info
module has agather_subset
parameter that limits the scope of what is reqeusted by API calls to the vserver, which is needed because read/write permissions set for a specific SVM level don't allow higher level info gathering, and otherwise would return a "403 Unauthorized" error.The
netapp.ontap.na_ontap_snapshot
uses API calls to check to see if a snapshot of the same name exists, but doesn't use thisgather_subset
parameter, so the API call returns thenot authorized for that command
error. However, the module does successfully create a snapshot, but the overall Ansible module returns afailed
state with message"Error when creating snapshot: job reported error
.Without a
gather_subset
parameter, this module (and possibly others) fail similarly as described here: https://docs.ansible.com/ansible/latest/collections/netapp/ontap/na_ontap_rest_info_module.htmlComponent Name
netapp.ontap.na_ontap_snapshot
Ansible Version
ONTAP Collection Version
ONTAP Version
Playbook
Steps to Reproduce
Expected Results
I expect the module returns a "Changed" result.
Actual Results