ansible-collections / netapp.ontap

Ansible collection to support NetApp ONTAP configuration.
https://galaxy.ansible.com/netapp/ontap
GNU General Public License v3.0
51 stars 34 forks source link

"owning_resource" in na_ontap_rest_info #194

Closed ansibleguy76 closed 2 months ago

ansibleguy76 commented 6 months ago

Summary

The documentation doesn't clearly say that "owning_resource" ONLY works for the 5 subsets mentioned. Also the module doesn't throw an error, when used on other subsets.

Component Name

na_ontap_rest_info

Ansible Version

$ ansible --version
not relevant

ONTAP Collection Version

$ ansible-galaxy collection list
not relevant

ONTAP Version

sridharc-vsim34::> version
NetApp Release 9.7.0: Tue May 18 10:45:16 UTC 2021
not relevant

Playbook

- name: Get all LUN mappings 
  netapp.ontap.na_ontap_rest_info:
    gather_subset:
      - "protocols/san/lun-maps"
    use_python_keys:            true
    owning_resource: 
      svm_name: "{{ svm_name }}"
    <<: *auth
  register: lun_map_info

Steps to Reproduce

- name: Get all LUN mappings 
  netapp.ontap.na_ontap_rest_info:
    gather_subset:
      - "protocols/san/lun-maps"
    use_python_keys:            true
    owning_resource: 
      svm_name: "{{ svm_name }}"
    <<: *auth
  register: lun_map_info

Expected Results

I expected that only the lunmaps from the specified svm were going to be returned, but all cluster lunmaps are returned. Or throw an error if used incorrectly. Also the documentation should be changed with a clear example where to use parameters and when to use owning_resource. It now says "it's required for these 5 subsets". It should say : "is required and only works with these 5 subsets"

Actual Results

In a decommissioning playbook, this took offline 1500 luns at a customer!
carchi8py commented 6 months ago

We have the folllowing story open for this DEVOPS-6584

carchi8py commented 5 months ago

@ansibleguy76 This was recently fixed and merge in yesterday. It will be part of the next release.