netapp.ontap.na_ontap_interface – NetApp ONTAP LIF configuration
Note
This plugin is part of the netapp.ontap collection (version 21.14.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
.
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.
Ansible 2.9
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.
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.
To enable http on the cluster you must run the following commands ‘set -privilege advanced;’ ‘system services web modify -http-enabled true;’
Parameters
Parameter |
Comments |
---|---|
Specifies the LIF’s IP address. ZAPI - Required when REST - Required when |
|
Specifies the administrative status of the LIF. Choices:
|
|
path to SSL client cert file (.pem). not supported with python 2.6. |
|
Specifies the LIF’s current node. By default, this is home_node |
|
Specifies the LIF’s current port. |
|
The data protocol for which the FC interface is configured. Ignored with ZAPI or for IP interfaces. Required for create on for a FC type interface. Choices:
|
|
Specifies the unique, fully qualified domain name of the DNS zone of this LIF. not supported with REST. |
|
Specifies the failover group for the LIF. Not supported with REST. |
|
Specifies the failover policy for the LIF. When using REST, this values are mapped to ‘home_port_only’, ‘default’, ‘home_node_only’, ‘sfo_partners_only’, ‘broadcast_domain_only’. Choices:
|
|
Specifies the failover scope for the LIF. REST only, and only for IP interfaces. Not supported for FC interfaces. Choices:
|
|
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. |
|
Specifies the firewall policy for the LIF. This option is deprecated in REST. With REST, the module tries to derive a service_policy and may error out. |
|
Set this to true to acquire the address from the named subnet and assign the subnet to the LIF. not supported with REST. Choices:
|
|
name of the interface to be renamed |
|
Specifies the LIF’s home node. By default, the first node from the cluster is considered as home node |
|
Specifies the LIF’s home port. Required when |
|
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:
|
|
ignore unsupported options that should not be relevant. ignored with ZAPI. Choices:
Default: [“force_subnet_association”] |
|
Specifies the logical interface (LIF) name. |
|
type of the interface. IP is assumed if address or netmask are present. IP interfaces includes cluster, intercluster, management, and NFS, CIFS, iSCSI interfaces. FC interfaces includes FCP and NVME-FC interfaces. ignored with ZAPI. Choices:
|
|
IPspace name is required with REST for cluster-scoped interfaces. It is optional with SVM scope. ignored with ZAPI. |
|
If true, data LIF will revert to its home node under certain circumstances such as startup, and load balancing migration capability is disabled automatically Choices:
|
|
Specifies if DNS update is enabled for this LIF. Dynamic updates will be sent for this LIF if updates are enabled at Vserver level. Not supported with REST. Choices:
|
|
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. Not supported in REST Choices:
|
|
path to SSL client key file. |
|
If True, this IP address will listen for DNS queries for the dnszone specified. Not supported with REST. Choices:
|
|
Specifies the LIF’s netmask. ZAPI - Required when REST - Required when |
|
The ontap api version to use |
|
Password for the specified user. |
|
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. This option is ignored with REST, though it can be used to derive |
|
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 This option is deprecated in REST. With REST, the module tries to derive a service_policy and may error out. |
|
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. |
|
Whether the specified interface should exist or not. Choices:
|
|
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. Not supported in REST. |
|
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 Default: “auto” |
|
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:
|
|
The name of the vserver to use. Required with ZAPI. Required with REST for SVM-scoped interfaces. Invalid with REST for cluster-scoped interfaces. |
Notes
Note
REST support is experimental and requires ONTAP 9.7 or later.
ZAPI is selected if
use_rest
is set to never or auto. We will restore auto to its expected behavior in a few months.REST is only selected if
use_rest
is set to always.The modules prefixed with na_ontap are built to support the ONTAP storage platform.
Examples
- name: Create interface - ZAPI
netapp.ontap.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 data interface - REST - NAS
netapp.ontap.na_ontap_interface:
state: present
interface_name: data2
home_port: e0d
home_node: laurentn-vsim1
admin_status: up
failover_scope: home_node_only
service_policy: default-data-files
is_auto_revert: true
interface_type: ip
address: 10.10.10.10
netmask: 255.255.255.0
vserver: svm1
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
- name: Create cluster interface - ZAPI
netapp.ontap.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: Create cluster interface - REST
netapp.ontap.na_ontap_interface:
state: present
interface_name: cluster_lif
home_port: e0a
home_node: cluster1-01
service_policy: default-cluster
admin_status: up
is_auto_revert: true
vserver: Cluster
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
- name: Rename interface
netapp.ontap.na_ontap_interface:
state: present
from_name: ansibleSVM_lif
interface_name: ansibleSVM_lif01
vserver: ansibleSVM
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>