netapp.ontap.na_ontap_interface – NetApp ONTAP LIF configuration¶
Note
This plugin is part of the netapp.ontap collection (version 20.12.0).
To install it use: ansible-galaxy collection install netapp.ontap
.
To use it in a playbook, specify: netapp.ontap.na_ontap_interface
.
New in version 2.6.0: of netapp.ontap
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 |
---|---|---|
address
string
|
Specifies the LIF's IP address.
Required when
state=present and is_ipv4_link_local if false and subnet_name is not set. |
|
admin_status
string
|
|
Specifies the administrative status of the LIF.
|
cert_filepath
string
added in 20.6.0 of netapp.ontap
|
path to SSL client cert file (.pem).
not supported with python 2.6.
|
|
current_node
string
|
Specifies the LIF's current node.
By default, this is home_node
|
|
current_port
string
|
Specifies the LIF's current port.
|
|
dns_domain_name
string
added in 2.9.0 of netapp.ontap
|
Specifies the unique, fully qualified domain name of the DNS zone of this LIF.
|
|
failover_group
string
added in 20.1.0 of netapp.ontap
|
Specifies the failover group for the LIF.
|
|
failover_policy
string
|
|
Specifies the failover policy for the LIF.
|
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.
|
|
firewall_policy
string
|
Specifies the firewall policy for the LIF.
|
|
force_subnet_association
boolean
added in 2.9.0 of netapp.ontap
|
|
Set this to true to acquire the address from the named subnet and assign the subnet to the LIF.
|
home_node
string
|
Specifies the LIF's home node.
By default, the first node from the cluster is considered as home node
|
|
home_port
string
|
Specifies the LIF's home port.
Required when
state=present |
|
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
|
|
Enable and disable https.
Ignored when using REST as only https is supported.
Ignored when using SSL certificate authentication as it requires SSL.
|
interface_name
string
/ required
|
Specifies the logical interface (LIF) name.
|
|
is_auto_revert
boolean
|
|
If true, data LIF will revert to its home node under certain circumstances such as startup,
and load balancing migration capability is disabled automatically
|
is_dns_update_enabled
boolean
added in 2.9.0 of netapp.ontap
|
|
Specifies if DNS update is enabled for this LIF. Dynamic updates will be sent for this LIF if updates are enabled at Vserver level.
|
is_ipv4_link_local
boolean
added in 20.1.0 of netapp.ontap
|
|
Specifies the LIF's are to acquire a ipv4 link local address.
Use case for this is when creating Cluster LIFs to allow for auto assignment of ipv4 link local address.
|
key_filepath
string
added in 20.6.0 of netapp.ontap
|
path to SSL client key file.
|
|
listen_for_dns_query
boolean
added in 2.9.0 of netapp.ontap
|
|
If True, this IP address will listen for DNS queries for the dnszone specified.
|
netmask
string
|
Specifies the LIF's netmask.
Required when
state=present and is_ipv4_link_local if false and subnet_name is not set. |
|
ontapi
integer
|
The ontap api version to use
|
|
password
string
|
Password for the specified user.
aliases: pass |
|
protocols
list
/ elements=string
|
Specifies the list of data protocols configured on the LIF. By default, the values in this element are nfs, cifs and fcache.
Other supported protocols are iscsi and fcp. A LIF can be configured to not support any data protocols by specifying 'none'.
Protocol values of none, iscsi, fc-nvme or fcp can't be combined with any other data protocol(s).
address, netmask and firewall_policy parameters are not supported for 'fc-nvme' option.
|
|
role
string
|
Specifies the role of the LIF.
When setting role as "intercluster" or "cluster", setting protocol is not supported.
When creating a "cluster" role, the node name will appear as the prefix in the name of LIF.
For example, if the specified name is clif and node name is node1, the LIF name appears in the ONTAP as node1_clif.
Possible values are 'undef', 'cluster', 'data', 'node-mgmt', 'intercluster', 'cluster-mgmt'.
Required when
state=present unless service_policy is present and ONTAP version is 9.8 or better. |
|
service_policy
string
added in 20.4.0 of netapp.ontap
|
Starting with ONTAP 9.5, you can configure LIF service policies to identify a single service or a list of services that will use a LIF.
In ONTAP 9.5, you can assign service policies only for LIFs in the admin SVM.
In ONTAP 9.6, you can additionally assign service policies for LIFs in the data SVMs.
When you specify a service policy for a LIF, you need not specify the data protocol and role for the LIF.
NOTE that role is still required because of a ZAPI issue. This limitation is removed in ONTAP 9.8.
Creating LIFs by specifying the role and data protocols is also supported.
|
|
state
string
|
|
Whether the specified interface should exist or not.
|
subnet_name
string
added in 2.8.0 of netapp.ontap
|
Subnet where the interface address is allocated from.
If the option is not used, the IP address will need to be provided by the administrator during configuration.
|
|
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
|
|
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.
|
Examples¶
- name: Create interface
na_ontap_interface:
state: present
interface_name: data2
home_port: e0d
home_node: laurentn-vsim1
role: data
protocols:
- nfs
- cifs
admin_status: up
failover_policy: local-only
firewall_policy: mgmt
is_auto_revert: true
address: 10.10.10.10
netmask: 255.255.255.0
force_subnet_association: false
dns_domain_name: test.com
listen_for_dns_query: true
is_dns_update_enabled: true
vserver: svm1
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
- name: Create cluster interface
na_ontap_interface:
state: present
interface_name: cluster_lif
home_port: e0a
home_node: cluster1-01
role: cluster
admin_status: up
is_auto_revert: true
is_ipv4_link_local: true
vserver: Cluster
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
- name: Migrate an interface
na_ontap_interface:
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
vserver: ansible
https: true
validate_certs: false
state: present
interface_name: carchi_interface3
home_port: e0d
home_node: ansdev-stor-1
current_node: ansdev-stor-2
role: data
failover_policy: local-only
firewall_policy: mgmt
is_auto_revert: true
address: 10.10.10.12
netmask: 255.255.255.0
force_subnet_association: false
admin_status: up
- name: Delete interface
na_ontap_interface:
state: absent
interface_name: data2
vserver: svm1
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
Authors¶
NetApp Ansible Team (@carchi8py) <ng-ansibleteam@netapp.com>