Debian Codegraph @

ansible_collections/netapp/ontap/playbooks/examples/rest_apis/list_aggregates.yaml

raw
1 ---
2 - name: ONTAP list aggregates
3 gather_facts: false
4 hosts: localhost
5
6 module_defaults:
7 group/netapp.ontap.netapp_ontap:
8 hostname: '{{ clusters.cluster1.admin_ip }}'
9 username: '{{ clusters.cluster1.admin_username }}'
10 password: '{{ clusters.cluster1.admin_password }}'
11 https: true
12 validate_certs: false
13
14 tasks:
15 - name: List aggregates
16 netapp.ontap.na_ontap_rest_info:
17 gather_subset:
18 - storage/aggregates
19 fields: 'block_storage,space'
20 # store the results to use them in another task
21 register: aggregates
22
23 # call this play as:
24 #
25 # ansible-playbook -v list_aggregates.yaml [email protected]
26 #
27 # with clusters.yaml providing credentials and IP addresses to connect to a cluster, eg:
28 #
29 # clusters:
30 # cluster1:
31 # admin_username: "{{ admin_username }}"
32 # admin_password: "{{ admin_password }}"
33 # admin_ip: "{{ admin_ips[0] }}"
34 # cluster2:
35 # admin_username: "{{ admin_username }}"
36 # admin_password: "{{ admin_password }}"
37 # admin_ip: "{{ admin_ips[1] }}"
38 #
39 # NOTE: module_defaults requires Ansible 2.12 as a minimum.
40 # With earlier versions of Ansible, move the values from lines 10 to 14 under the tasks, or use an alias.