dellemc.unity.nfs module – Manage NFS export on Unity storage system
Note
This module is part of the dellemc.unity collection (version 2.0.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 dellemc.unity
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: dellemc.unity.nfs
.
New in dellemc.unity 1.1.0
Synopsis
Managing NFS export on Unity storage system includes- Create new NFS export, Modify NFS export attributes, Display NFS export details, Delete NFS export.
Requirements
The below requirements are needed on the host that executes this module.
A Dell Unity Storage device version 5.1 or later.
Ansible-core 2.14 or later.
Python 3.9, 3.10 or 3.11.
Storops Python SDK 1.2.11.
Parameters
Parameter |
Comments |
---|---|
If Mandatory while adding access hosts. Choices:
|
|
Specifies the group ID of the anonymous account. If not specified at the time of creation, it will be set to 4294967294. |
|
Specifies the user ID of the anonymous account. If not specified at the time of creation, it will be set to 4294967294. |
|
Default access level for all hosts that can access the NFS export. For hosts that need different access than the default, they can be configured by adding to the list. If default_access is not mentioned during creation, then NFS export will be created with Choices:
|
|
Description of the NFS export. Optional parameter when creating a NFS export. To modify description, pass the new value in description field. To remove description, pass the empty value in description field. |
|
ID of the filesystem. This is a unique ID generated by Unity storage system. |
|
Name of the filesystem for which NFS export will be created. Either filesystem or snapshot is required for creation of the NFS. If filesystem_name is specified, then nas_server is required to uniquely identify the filesystem. If filesystem parameter is provided, then snapshot cannot be specified. |
|
Define whether the hosts can access the NFS export. Required when adding or removing access of hosts from the export. Choices:
|
|
NFS enforced security type for users accessing a NFS export. If not specified at the time of creation, it will be set to Choices:
|
|
ID of the NAS server on which filesystem will be hosted. |
|
Name of the NAS server on which filesystem will be hosted. |
|
ID of the nfs export. This is a unique ID generated by Unity storage system. |
|
Name of the nfs export. Mandatory for create operation. Specify either nfs_export_name or nfs_export_id (but not both) for any operation. |
|
Hosts with no access to the NFS export. List of dictionaries. Each dictionary will have any of the keys from host_name, host_id, subnet, netgroup, domain and ip_address. If adv_host_mgmt_enabled is If adv_host_mgmt_enabled is |
|
DNS domain, where all NFS clients in the domain are included in the host list. |
|
ID of the host. |
|
Name of the host. |
|
IP address of the host. |
|
Netgroup that is defined in NIS or the local netgroup file. |
|
Subnet can be an ‘IP address/netmask’ or ‘IP address/prefix length’. |
|
The password of the Unity management server. |
|
Local path to export relative to the NAS server root. With NFS, each export of a file_system or file_snap must have a unique local path. Mandatory while creating NFS export. |
|
Port number through which communication happens with Unity management server. Default: |
|
Hosts with read-only access to the NFS export. List of dictionaries. Each dictionary will have any of the keys from host_name, host_id, subnet, netgroup, domain and ip_address. If adv_host_mgmt_enabled is If adv_host_mgmt_enabled is |
|
DNS domain, where all NFS clients in the domain are included in the host list. |
|
ID of the host. |
|
Name of the host. |
|
IP address of the host. |
|
Netgroup that is defined in NIS or the local netgroup file. |
|
Subnet can be an ‘IP address/netmask’ or ‘IP address/prefix length’. |
|
Hosts with read-only for root user access to the NFS export. List of dictionaries. Each dictionary will have any of the keys from host_name, host_id, subnet, netgroup, domain and ip_address. If adv_host_mgmt_enabled is If adv_host_mgmt_enabled is |
|
DNS domain, where all NFS clients in the domain are included in the host list. |
|
ID of the host. |
|
Name of the host. |
|
IP address of the host. |
|
Netgroup that is defined in NIS or the local netgroup file. |
|
Subnet can be an ‘IP address/netmask’ or ‘IP address/prefix length’. |
|
Hosts with read and write access to the NFS export. List of dictionaries. Each dictionary will have any of the keys from host_name, host_id, subnet, netgroup, domain and ip_address. If adv_host_mgmt_enabled is If adv_host_mgmt_enabled is |
|
DNS domain, where all NFS clients in the domain are included in the host list. |
|
ID of the host. |
|
Name of the host. |
|
IP address of the host. |
|
Netgroup that is defined in NIS or the local netgroup file. |
|
Subnet can be an ‘IP address/netmask’ or ‘IP address/prefix length’. |
|
Hosts with read and write for root user access to the NFS export. List of dictionaries. Each dictionary will have any of the keys from host_name, host_id, subnet, netgroup, domain and ip_address. If adv_host_mgmt_enabled is If adv_host_mgmt_enabled is |
|
DNS domain, where all NFS clients in the domain are included in the host list. |
|
ID of the host. |
|
Name of the host. |
|
IP address of the host. |
|
Netgroup that is defined in NIS or the local netgroup file. |
|
Subnet can be an ‘IP address/netmask’ or ‘IP address/prefix length’. |
|
ID of the snapshot. This is a unique ID generated by Unity storage system. |
|
Name of the snapshot for which NFS export will be created. Either filesystem or snapshot is required for creation of the NFS export. If snapshot parameter is provided, then filesystem cannot be specified. |
|
State variable to determine whether NFS export will exist or not. Choices:
|
|
IP or FQDN of the Unity management server. |
|
The username of the Unity management server. |
|
Boolean variable to specify whether or not to validate SSL certificate.
Choices:
|
Notes
Note
The check_mode is not supported.
The modules present in this collection named as ‘dellemc.unity’ are built to support the Dell Unity storage platform.
Examples
- name: Create nfs export from filesystem
dellemc.unity.nfs:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
nfs_export_name: "ansible_nfs_from_fs"
path: '/'
filesystem_id: "fs_377"
state: "present"
- name: Create nfs export from snapshot
dellemc.unity.nfs:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
nfs_export_name: "ansible_nfs_from_snap"
path: '/'
snapshot_name: "ansible_fs_snap"
state: "present"
- name: Modify nfs export
dellemc.unity.nfs:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
nfs_export_name: "ansible_nfs_from_fs"
nas_server_id: "nas_3"
description: ""
default_access: "READ_ONLY_ROOT"
anonymous_gid: 4294967290
anonymous_uid: 4294967290
state: "present"
- name: Add host in nfs export with adv_host_mgmt_enabled as true
dellemc.unity.nfs:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
nfs_export_name: "ansible_nfs_from_fs"
filesystem_id: "fs_377"
adv_host_mgmt_enabled: true
no_access_hosts:
- host_id: "Host_1"
read_only_hosts:
- host_id: "Host_2"
read_only_root_hosts:
- host_name: "host_name1"
read_write_hosts:
- host_name: "host_name2"
read_write_root_hosts:
- ip_address: "1.1.1.1"
host_state: "present-in-export"
state: "present"
- name: Remove host in nfs export with adv_host_mgmt_enabled as true
dellemc.unity.nfs:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
nfs_export_name: "ansible_nfs_from_fs"
filesystem_id: "fs_377"
adv_host_mgmt_enabled: true
no_access_hosts:
- host_id: "Host_1"
read_only_hosts:
- host_id: "Host_2"
read_only_root_hosts:
- host_name: "host_name1"
read_write_hosts:
- host_name: "host_name2"
read_write_root_hosts:
- ip_address: "1.1.1.1"
host_state: "absent-in-export"
state: "present"
- name: Add host in nfs export with adv_host_mgmt_enabled as false
dellemc.unity.nfs:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
nfs_export_name: "ansible_nfs_from_fs"
filesystem_id: "fs_377"
adv_host_mgmt_enabled: false
no_access_hosts:
- domain: "google.com"
read_only_hosts:
- netgroup: "netgroup_admin"
read_only_root_hosts:
- host_name: "host5"
read_write_hosts:
- subnet: "168.159.57.4/255.255.255.0"
read_write_root_hosts:
- ip_address: "10.255.2.4"
host_state: "present-in-export"
state: "present"
- name: Remove host in nfs export with adv_host_mgmt_enabled as false
dellemc.unity.nfs:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
nfs_export_name: "ansible_nfs_from_fs"
filesystem_id: "fs_377"
adv_host_mgmt_enabled: false
no_access_hosts:
- domain: "google.com"
read_only_hosts:
- netgroup: "netgroup_admin"
read_only_root_hosts:
- host_name: "host5"
read_write_hosts:
- subnet: "168.159.57.4/255.255.255.0"
read_write_root_hosts:
- ip_address: "10.255.2.4"
host_state: "absent-in-export"
state: "present"
- name: Get nfs details
dellemc.unity.nfs:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
nfs_export_id: "NFSShare_291"
state: "present"
- name: Delete nfs export by nfs name
dellemc.unity.nfs:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
nfs_export_name: "ansible_nfs_name"
nas_server_name: "ansible_nas_name"
state: "absent"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Whether or not the resource has changed. Returned: always Sample: |
|
Details of the nfs export. Returned: When nfs export exists. Sample: |
|
Group ID of the anonymous account Returned: success |
|
User ID of the anonymous account Returned: success |
|
Default access level for all hosts that can access export Returned: success |
|
Description about the nfs export Returned: success |
|
Export paths that can be used to mount and access export Returned: success |
|
Details of the filesystem on which nfs export is present Returned: success |
|
filesystem details Returned: success |
|
ID of the filesystem Returned: success |
|
Name of the filesystem Returned: success |
|
ID of the nfs export Returned: success |
|
NFS enforced security type for users accessing an export Returned: success |
|
Name of the nfs export Returned: success |
|
Details of the nas server Returned: success |
|
NAS server details Returned: success |
|
ID of the nas server Returned: success |
|
Name of the nas server Returned: success |
|
Hosts with no access to the nfs export Returned: success |
|
Hosts with read-only access to the nfs export Returned: success |
|
Hosts with read-only for root user access to the nfs export Returned: success |
|
Hosts with read and write access to the nfs export Returned: success |
|
Hosts with read and write for root user access to export Returned: success |
|
NFS export type. i.e. filesystem or snapshot Returned: success |