netapp.ontap.na_ontap_info – NetApp information gatherer

Note

This plugin is part of the netapp.ontap collection (version 21.12.0).

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.

To use it in a playbook, specify: netapp.ontap.na_ontap_info.

New in version 2.9.0: of netapp.ontap

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.

  • A physical or virtual clustered Data ONTAP system. The modules support Data ONTAP 9.1 and onward.
  • Ansible 2.9
  • Python3 netapp-lib (2018.11.13) or later. Install using ‘pip install netapp-lib’
  • REST support requires ONTAP 9.6 or later.
  • To enable http on the cluster you must run the following commands ‘set -privilege advanced;’ ‘system services web modify -http-enabled true;’
  • netapp-lib 2020.3.12 is strongly recommended as it provides better error reporting for connection issues.
  • netapp_lib

Parameters

Parameter Choices/Defaults Comments
cert_filepath
string
added in 20.6.0 of netapp.ontap
path to SSL client cert file (.pem).
not supported with python 2.6.
continue_on_error
list / elements=string
Default:
"never"
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.
desired_attributes
dictionary
added in 20.6.0 of netapp.ontap
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.
feature_flags
dictionary
added in 20.5.0 of netapp.ontap
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.
gather_subset
list / elements=string
Default:
"all"
When supplied, this argument will restrict the information collected to a given subset. Possible values for this argument include
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_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 M(!) to specify that a specific subset should not be collected.
nvme is supported with ONTAP 9.4 onwards.
use "help" to get a list of supported information for your system.
hostname
string / required
The hostname or IP address of the ONTAP instance.
http_port
integer
Override the default port (80 or 443) with this port
https
boolean
    Choices:
  • no
  • yes
Enable and disable https.
Ignored when using REST as only https is supported.
Ignored when using SSL certificate authentication as it requires SSL.
key_filepath
string
added in 20.6.0 of netapp.ontap
path to SSL client key file.
max_records
integer
added in 20.2.0 of netapp.ontap
Default:
1024
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.
ontapi
integer
The ontap api version to use
password
string
Password for the specified user.

aliases: pass
query
dictionary
added in 20.7.0 of netapp.ontap
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.
state
string
deprecated as of 21.1.0.
this option was ignored and continues to be ignored.
summary
boolean
added in 20.4.0 of netapp.ontap
    Choices:
  • no
  • yes
Boolean flag to control return all attributes of the module info or only the names.
If true, only names are returned.
use_native_zapi_tags
boolean
added in 20.6.0 of netapp.ontap
    Choices:
  • no
  • yes
By default, - in the returned dictionary keys are translated to _.
If set to true, the translation is disabled.
use_rest
string
Default:
"auto"
REST API if supported by the target system for all the resources and attributes the module requires. Otherwise will revert to ZAPI.
always -- will always use the REST API
never -- will always use the ZAPI
auto -- will try to use the REST Api
username
string
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
1. basic authentication, using username and password,
2. SSL certificate authentication, using a ssl client cert file, and optionally a private key file.
To use a certificate, the certificate must have been installed in the ONTAP cluster, and cert authentication must have been enabled.

aliases: user
validate_certs
boolean
    Choices:
  • no
  • yes
If set to no, the SSL certificates will not be validated.
This should only set to False used on personally controlled sites using self-signed certificates.
volume_move_target_aggr_info
dictionary
added in 20.5.0 of netapp.ontap
Required options for volume_move_target_aggr_info
volume_name
string / required
added in 20.5.0 of netapp.ontap
Volume name to get target aggr info for
vserver
string / required
added in 20.5.0 of netapp.ontap
vserver the Volume lives on
vserver
string
added in 19.11.0 of netapp.ontap
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.

Examples

- name: Get NetApp info as Cluster Admin (Password Authentication)
  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
  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
  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
  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
  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
  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
  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
  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
  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 Returned Description
ontap_info
dictionary
always
Returns various information about NetApp cluster configuration

Sample:
{ "ontap_info": { "aggregate_info": {...}, "autosupport_check_info": {...}, "cluster_identity_info": {...}, "cluster_image_info": {...}, "cluster_node_info": {...}, "igroup_info": {...}, "iscsi_service_info": {...}, "license_info": {...}, "lun_info": {...}, "metrocluster_check_info": {...}, "metrocluster_info": {...}, "metrocluster_node_info": {...}, "net_dns_info": {...}, "net_ifgrp_info": {...}, "net_interface_info": {...}, "net_interface_service_policy_info": {...}, "net_port_info": {...}, "ontap_system_version": {...}, "ontap_version": {...}, "ontapi_version": {...}, "qos_policy_info": {...}, "qos_adaptive_policy_info": {...}, "qtree_info": {...}, "quota_report_info": {...}, "security_key_manager_key_info": {...}, "security_login_account_info": {...}, "snapmirror_info": {...} "snapmirror_destination_info": {...} "storage_bridge_info": {...} "storage_failover_info": {...}, "volume_info": {...}, "vserver_login_banner_info": {...}, "vserver_motd_info": {...}, "vserver_info": {...}, "vserver_nfs_info": {...}, "vscan_status_info": {...}, "vscan_scanner_pool_info": {...}, "vscan_connection_status_all_info": {...}, "vscan_connection_extended_stats_info": {...} }


Authors

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/netapp/ontap/na_ontap_info_module.html