netapp.ontap.na_ontap_info module – NetApp information gatherer
Note
This module is part of the netapp.ontap collection (version 21.24.1).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install netapp.ontap
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: netapp.ontap.na_ontap_info
.
New in netapp.ontap 2.9.0
Synopsis
This module allows you to gather various information about ONTAP configuration
Requirements
The below requirements are needed on the host that executes this module.
Ansible 2.9 or later - 2.12 or later is recommended.
Python3 - 3.9 or later is recommended.
When using ZAPI, netapp-lib 2018.11.13 or later (install using ‘pip install netapp-lib’), netapp-lib 2020.3.12 is strongly recommended as it provides better error reporting for connection issues
a physical or virtual clustered Data ONTAP system, the modules support Data ONTAP 9.1 and onward, REST support requires ONTAP 9.6 or later
netapp_lib
Parameters
Parameter |
Comments |
---|---|
path to SSL client cert file (.pem). not supported with python 2.6. |
|
By default, this module fails on the first error. This option allows to provide a list of errors that are not failing the module. Errors in the list are reported in the output, under the related info element, as an “error” entry. Possible values are always, never, missing_vserver_api_error, rpc_error, other_error. missing_vserver_api_error - most likely the API is available at cluster level but not vserver level. rpc_error - some queries are failing because the node cannot reach another node in the cluster. key_error - a query is failing because the returned data does not contain an expected key. for key errors, make sure to report this in Slack. It may be a change in a new ONTAP version. other_error - anything not in the above list. always will continue on any error, never will fail on any error, they cannot be used with any other keyword. Default: |
|
Advanced feature requiring to understand ZAPI internals. Allows to request a specific attribute that is not returned by default, or to limit the returned attributes. A dictionary for the zapi desired-attributes element. An XML tag <tag>value</tag> is a dictionary with tag as the key. Value can be another dictionary, a list of dictionaries, a string, or nothing. eg <tag/> is represented as tag: Only a single subset can be called at a time if this option is set. It is the caller responsibity to make sure key attributes are present in the right position. The module will error out if any key attribute is missing. |
|
Enable or disable a new feature. This can be used to enable an experimental feature or disable a new feature that breaks backward compatibility. Supported keys and values are subject to change without notice. Unknown keys are ignored. |
|
Override the cluster ONTAP version when using REST. The behavior is undefined if the version does not match the target cluster. This is provided as a work-around when the cluster version cannot be read because of permission issues. See https://github.com/ansible-collections/netapp.ontap/wiki/Known-issues. This should be in the form 9.10 or 9.10.1 with each element being an integer number. When Ignored with ZAPI. |
|
When supplied, this argument will restrict the information collected to a given subset. Possible values for this argument include active_directory_account_info aggregate_info aggr_efficiency_info autosupport_check_info cifs_options_info cifs_server_info cifs_share_info cifs_vserver_security_info cluster_identity_info cluster_image_info cluster_log_forwarding_info cluster_node_info cluster_peer_info cluster_switch_info clock_info disk_info env_sensors_info event_notification_destination_info event_notification_info export_policy_info export_rule_info fcp_adapter_info fcp_alias_info fcp_service_info igroup_info iscsi_service_info job_schedule_cron_info kerberos_realm_info ldap_client ldap_config license_info lun_info lun_map_info metrocluster_check_info metrocluster_info metrocluster_node_info net_dev_discovery_info net_dns_info net_failover_group_info net_firewall_info net_ifgrp_info net_interface_info net_interface_service_policy_info net_ipspaces_info net_port_info net_port_broadcast_domain_info net_routes_info net_vlan_info nfs_info ntfs_dacl_info ntfs_sd_info ntp_server_info nvme_info nvme_interface_info nvme_namespace_info nvme_subsystem_info ontap_system_version ontap_version ontapi_version qos_adaptive_policy_info qos_policy_info qtree_info quota_policy_info quota_report_info role_info security_key_manager_key_info security_login_account_info security_login_role_config_info security_login_role_info service_processor_info service_processor_network_info shelf_info sis_info sis_policy_info snapmirror_info snapmirror_destination_info snapmirror_policy_info snapshot_info snapshot_policy_info storage_failover_info storage_bridge_info subsys_health_info sysconfig_info sys_cluster_alerts volume_info volume_space_info vscan_info vscan_status_info vscan_scanner_pool_info vscan_connection_status_all_info vscan_connection_extended_stats_info vserver_info vserver_login_banner_info vserver_motd_info vserver_nfs_info vserver_peer_info Can specify a list of values to include a larger subset. Values can also be used with an initial nvme is supported with ONTAP 9.4 onwards. use “help” to get a list of supported information for your system. with lun_info, serial_hex and naa_id are computed when serial_number is present. Default: |
|
The hostname or IP address of the ONTAP instance. |
|
Override the default port (80 or 443) with this port |
|
Enable and disable https. Ignored when using REST as only https is supported. Ignored when using SSL certificate authentication as it requires SSL. Choices:
|
|
path to SSL client key file. |
|
Maximum number of records returned in a single ZAPI call. Valid range is [1..2^32-1]. This parameter controls internal behavior of this module. Default: |
|
The ontap api version to use |
|
Password for the specified user. |
|
Advanced feature requiring to understand ZAPI internals. Allows to specify which objects to return. A dictionary for the zapi query element. An XML tag <tag>value</tag> is a dictionary with tag as the key. Value can be another dictionary, a list of dictionaries, a string, or nothing. eg <tag/> is represented as tag: Only a single subset can be called at a time if this option is set. |
|
deprecated as of 21.1.0. this option was ignored and continues to be ignored. |
|
Boolean flag to control return all attributes of the module info or only the names. If true, only names are returned. Choices:
|
|
By default, - in the returned dictionary keys are translated to _. If set to true, the translation is disabled. Choices:
|
|
Whether to use REST or ZAPI. always – will always use the REST API if the module supports REST. A warning is issued if the module does not support REST. An error is issued if a module option is not supported in REST. never – will always use ZAPI if the module supports ZAPI. An error may be issued if a REST option is not supported in ZAPI. auto – will try to use the REST API if the module supports REST and modules options are supported. Reverts to ZAPI otherwise. Default: |
|
This can be a Cluster-scoped or SVM-scoped account, depending on whether a Cluster-level or SVM-level API is required. For more information, please read the documentation https://mysupport.netapp.com/NOW/download/software/nmsdk/9.4/. Two authentication methods are supported
To use a certificate, the certificate must have been installed in the ONTAP cluster, and cert authentication must have been enabled. |
|
If set to This should only set to Choices:
|
|
Required options for volume_move_target_aggr_info |
|
Volume name to get target aggr info for |
|
vserver the Volume lives on |
|
If present, ‘vserver tunneling’ will limit the output to the vserver scope. Note that not all subsets are supported on a vserver, and ‘all’ will trigger an error. |
Notes
Note
The modules prefixed with na_ontap are built to support the ONTAP storage platform.
https is enabled by default and recommended. To enable http on the cluster you must run the following commands ‘set -privilege advanced;’ ‘system services web modify -http-enabled true;’
Examples
- name: Get NetApp info as Cluster Admin (Password Authentication)
netapp.ontap.na_ontap_info:
hostname: "na-vsim"
username: "admin"
password: "admins_password"
register: ontap_info
- debug:
msg: "{{ ontap_info.ontap_info }}"
- name: Get NetApp version as Vserver admin
netapp.ontap.na_ontap_info:
hostname: "na-vsim"
username: "vsadmin"
vserver: trident_svm
password: "vsadmins_password"
- name: run ontap info module using vserver tunneling and ignoring errors
netapp.ontap.na_ontap_info:
hostname: "na-vsim"
username: "admin"
password: "admins_password"
vserver: trident_svm
summary: true
continue_on_error:
- missing_vserver_api_error
- rpc_error
- name: Limit Info Gathering to Aggregate Information as Cluster Admin
netapp.ontap.na_ontap_info:
hostname: "na-vsim"
username: "admin"
password: "admins_password"
gather_subset: "aggregate_info"
register: ontap_info
- name: Limit Info Gathering to Volume and Lun Information as Cluster Admin
netapp.ontap.na_ontap_info:
hostname: "na-vsim"
username: "admin"
password: "admins_password"
gather_subset:
- volume_info
- lun_info
register: ontap_info
- name: Gather all info except for volume and lun information as Cluster Admin
netapp.ontap.na_ontap_info:
hostname: "na-vsim"
username: "admin"
password: "admins_password"
gather_subset:
- "!volume_info"
- "!lun_info"
register: ontap_info
- name: Gather Volume move information for a specific volume
netapp.ontap.na_ontap_info:
hostname: "na-vsim"
username: "admin"
password: "admins_password"
gather_subset: volume_move_target_aggr_info
volume_move_target_aggr_info:
volume_name: carchitest
vserver: ansible
- name: run ontap info module for aggregate module, requesting specific fields
netapp.ontap.na_ontap_info:
# <<: *login
gather_subset: aggregate_info
desired_attributes:
aggr-attributes:
aggr-inode-attributes:
files-private-used:
aggr-raid-attributes:
aggregate-type:
use_native_zapi_tags: true
register: ontap
- debug: var=ontap
- name: run ontap info to get offline volumes with dp in the name
netapp.ontap.na_ontap_info:
# <<: *cert_login
gather_subset: volume_info
query:
volume-attributes:
volume-id-attributes:
name: '*dp*'
volume-state-attributes:
state: offline
desired_attributes:
volume-attributes:
volume-id-attributes:
name:
volume-state-attributes:
state:
register: ontap
- debug: var=ontap
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Returns various information about NetApp cluster configuration Returned: always Sample: |