netapp.ontap.na_ontap_user – NetApp ONTAP user configuration and management

Note

This plugin is part of the netapp.ontap collection.

To install it use: ansible-galaxy collection install netapp.ontap.

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

New in version 2.6: of netapp.ontap

Synopsis

  • Create or destroy users.

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.

  • REST support requires ONTAP 9.6 or later.

  • Ansible 2.6

  • Ansible 2.9 or later is strongly recommended as it enables the new collection delivery system.

  • Python2 netapp-lib (2017.10.30) or later. Install using ‘pip install netapp-lib’

  • Python3 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.

  • To enable http on the cluster you must run the following commands ‘set -privilege advanced;’ ‘system services web modify -http-enabled true;’

Parameters

Parameter Choices/Defaults Comments
applications
list / elements=string / required
    Choices:
  • console
  • http
  • ontapi
  • rsh
  • snmp
  • service-processor
  • sp
  • ssh
  • telnet
List of application to grant access to.
Creating a login with application console, telnet, rsh, and service-processor for a data Vserver is not supported.
snmp is not supported in REST.

aliases: application
authentication_method
string / required
    Choices:
  • community
  • password
  • publickey
  • domain
  • nsswitch
  • usm
  • cert
Authentication method for the application.
Not all authentication methods are valid for an application.
Valid authentication methods for each application are as denoted in authentication_choices_description.
Password for console application
Password, domain, nsswitch, cert for http application.
Password, domain, nsswitch, cert for ontapi application.
Community for snmp application (when creating SNMPv1 and SNMPv2 users).
The usm and community for snmp application (when creating SNMPv3 users).
Password for sp application.
Password for rsh application.
Password for telnet application.
Password, publickey, domain, nsswitch for ssh application.
authentication_password
string
added in 20.6.0 of netapp.ontap
Password for the authentication protocol. This should be minimum 8 characters long.
This is required for 'md5', 'sha' and 'sha2-256' authentication protocols and not required for 'none'.
Only available for 'usm' authentication method and non modifiable.
authentication_protocol
string
added in 20.6.0 of netapp.ontap
    Choices:
  • none
  • md5
  • sha
  • sha2-256
Authentication protocol for the snmp user.
When cluster FIPS mode is on, 'sha' and 'sha2-256' are the only possible and valid values.
When cluster FIPS mode is off, the default value is 'none'.
When cluster FIPS mode is on, the default value is 'sha'.
Only available for 'usm' authentication method and non modifiable.
cert_filepath
string
added in 20.6.0 of netapp.ontap
path to SSL client cert file (.pem).
not supported with python 2.6.
engine_id
string
added in 20.6.0 of netapp.ontap
Authoritative entity's EngineID for the SNMPv3 user.
This should be specified as a hexadecimal string.
Engine ID with first bit set to 1 in first octet should have a minimum of 5 or maximum of 32 octets.
Engine Id with first bit set to 0 in the first octet should be 12 octets in length.
Engine Id cannot have all zeros in its address.
Only available for 'usm' authentication method and non modifiable.
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.
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.
lock_user
boolean
    Choices:
  • no
  • yes
Whether the specified user account is locked.
name
string / required
The name of the user to manage.
ontapi
integer
The ontap api version to use
password
string
Password for the specified user.

aliases: pass
privacy_password
string
added in 20.6.0 of netapp.ontap
Password for the privacy protocol. This should be minimum 8 characters long.
This is required for 'des' and 'aes128' privacy protocols and not required for 'none'.
Only available for 'usm' authentication method and non modifiable.
privacy_protocol
string
added in 20.6.0 of netapp.ontap
    Choices:
  • none
  • des
  • aes128
Privacy protocol for the snmp user.
When cluster FIPS mode is on, 'aes128' is the only possible and valid value.
When cluster FIPS mode is off, the default value is 'none'. When cluster FIPS mode is on, the default value is 'aes128'.
Only available for 'usm' authentication method and non modifiable.
remote_switch_ipaddress
string
added in 20.6.0 of netapp.ontap
This optionally specifies the IP Address of the remote switch.
The remote switch could be a cluster switch monitored by Cluster Switch Health Monitor (CSHM) or a Fiber Channel (FC) switch monitored by Metro Cluster Health Monitor (MCC-HM).
This is applicable only for a remote SNMPv3 user i.e. only if user is a remote (non-local) user, application is snmp and authentication method is usm.
role_name
string
The name of the role. Required when state=present
set_password
string
Password for the user account.
It is ignored for creating snmp users, but is required for creating non-snmp users.
For an existing user, this value will be used as the new password.
state
string
    Choices:
  • present ←
  • absent
Whether the specified user should exist or not.
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.
vserver
string / required
The name of the vserver to use.

aliases: svm

Notes

Note

  • The modules prefixed with na\_ontap are built to support the ONTAP storage platform.

Examples

- name: Create User
  na_ontap_user:
    state: present
    name: SampleUser
    applications: ssh,console
    authentication_method: password
    set_password: apn1242183u1298u41
    lock_user: True
    role_name: vsadmin
    vserver: ansibleVServer
    hostname: "{{ netapp_hostname }}"
    username: "{{ netapp_username }}"
    password: "{{ netapp_password }}"

- name: Delete User
  na_ontap_user:
    state: absent
    name: SampleUser
    applications: ssh
    authentication_method: password
    vserver: ansibleVServer
    hostname: "{{ netapp_hostname }}"
    username: "{{ netapp_username }}"
    password: "{{ netapp_password }}"

- name: Create user with snmp application (ZAPI)
  na_ontap_user:
    state: present
    name: test_cert_snmp
    applications: snmp
    authentication_method: usm
    role_name: admin
    authentication_protocol: md5
    authentication_password: '12345678'
    privacy_protocol: 'aes128'
    privacy_password: '12345678'
    engine_id: '7063514941000000000000'
    remote_switch_ipaddress: 10.0.0.0
    vserver: "{{ vserver }}"
    hostname: "{{ hostname }}"
    username: "{{ username }}"
    password: "{{ password }}"

Authors