I am trying to find how to get the number of luns in each volume. This is my draft but I cannot get it to work, could someone let me know why it is being skipped?
- name: Get all LUNs from clusters
na_ontap_rest_info:
gather_subset:
- "storage/luns"
fields:
- "svm"
use_python_keys: true
register: ontap_volumes2 - name: Print volume details
debug:
msg:
- "LUNS: {{ item.name }}"
loop:
"{{ ontap_volumes2.ontap_info.storage_luns.records }}"
loop_control:
label: "{{ item.name }}"
register: number_luns - name: Count LUNs
set_fact:
counter: "{{ counter | default(0) | int + 1 }}"
loop:
"{{ ontap_volumes.ontap_info.storage_volumes.records }}"
loop_control:
label: "{{ item.name }}"
when: item.name in number_luns