Can we do this with ansible script to list all volumes from all vservers on the netapp? I am automating the task to give me the list of all volumes from all vservers.I checked the netapp ontap collection and could not find anything in na_ontap_volume module or if there is any module which can get the volume names.Appreciate help TIA
#Ansible script to list all volumes from all vservers
1 messages · Page 1 of 1 (latest)
Use na_ontap_rest_info to query for information. https://docs.ansible.com/ansible/latest/collections/netapp/ontap/na_ontap_rest_info_module.html
@proven bolt - Is there any way we can do with out rest with direct ansible collections?
@glass beacon
Ansible ONTAP collection has modules such as na_ontap_rest_info, na_ontap_rest_cli, and na_ontap_restit for gathering information on ONTAP objects.
All the other modules in the collection make use of GET calls internally which is not available for module returns.
I had to figure out that the ..rest_info module only lists the volumes with its UUID, but not the hosting vserver. Did I miss a parameter that shows that or do I really need to parse this from rest_cli?
@pastel vault Have you tried passing fields like below?
- name: Retrieve volumes
netapp.ontap.na_ontap_rest_info:
gather_subset:
- storage/volumes
fields:
- name
- svm.name
register: ontap_vols