dellemc.powerstore.nfs (3.2.0) — module

Manage NFS exports for PowerStore

| "added in version" 1.1.0 of dellemc.powerstore"

Authors: Akash Shendge (@shenda1) <ansible.team@dell.com>

Install collection

Install with ansible-galaxy collection install dellemc.powerstore:==3.2.0


Add to requirements.yml

  collections:
    - name: dellemc.powerstore
      version: 3.2.0

Description

Managing NFS exports on PowerStore Storage System includes creating new NFS Export, getting details of NFS export, modifying attributes of NFS export, and deleting NFS export.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create NFS export (filesystem)
  dellemc.powerstore.nfs:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    nfs_export_name: "{{export_name1}}"
    filesystem: "{{filesystem}}"
    nas_server: "{{nas_server}}"
    path: "{{path1}}"
    description: "sample description"
    default_access: "NO_ACCESS"
    no_access_hosts:
      - "{{host5}}"
    read_only_hosts:
      - "{{host1}}"
    read_only_root_hosts:
      - "{{host2}}"
    read_write_hosts:
      - "{{host3}}"
    read_write_root_hosts:
      - "{{host4}}"
    min_security: "SYS"
    anonymous_uid: 1000
    anonymous_gid: 1000
    is_no_suid: true
    host_state: "present-in-export"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create NFS export Create NFS export for filesystem snapshot with mandatory parameters
  dellemc.powerstore.nfs:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    nfs_export_name: "{{export_name2}}"
    snapshot: "{{snapshot}}"
    nas_server: "{{nas_server}}"
    path: "{{path2}}"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get NFS export details using ID
  dellemc.powerstore.nfs:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    nfs_export_id: "{{export_id}}"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add Read-Only and Read-Write hosts to NFS export
  dellemc.powerstore.nfs:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    nfs_export_id: "{{export_id}}"
    read_only_hosts:
      - "{{host5}}"
    read_write_hosts:
      - "{{host6}}"
    host_state: "present-in-export"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove Read-Only and Read-Write hosts from NFS export
  dellemc.powerstore.nfs:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    nfs_export_id: "{{export_id}}"
    read_only_hosts:
      - "{{host1}}"
    read_write_hosts:
      - "{{host3}}"
    host_state: "absent-in-export"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify the attributes of NFS export
  dellemc.powerstore.nfs:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    nfs_export_id: "{{export_id}}"
    description: "modify description"
    default_access: "ROOT"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete NFS export using name
  dellemc.powerstore.nfs:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    nfs_export_name: "{{export_name}}"
    nas_server: "{{nas_server}}"
    state: "absent"

Inputs

    
path:
    description:
    - 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.
    type: str

port:
    description:
    - Port number for the PowerStore array.
    - If not passed, it will take 443 as default.
    type: int

user:
    description:
    - The username of the PowerStore host.
    required: true
    type: str

state:
    choices:
    - absent
    - present
    description:
    - Define whether the NFS export should exist or not.
    required: true
    type: str

timeout:
    default: 120
    description:
    - Time after which the connection will get terminated.
    - It is to be mentioned in seconds.
    type: int

array_ip:
    description:
    - IP or FQDN of the PowerStore management system.
    required: true
    type: str

password:
    description:
    - The password of the PowerStore host.
    required: true
    type: str

snapshot:
    description:
    - The ID/Name of the Snapshot for which NFS export will be created.
    - Either I(filesystem) or I(snapshot) is required for creation of the NFS Export.
    - If snapshot name is specified, then I(nas_server) is required to uniquely identify
      the snapshot.
    - If I(snapshot) parameter is provided, then I(filesystem) cannot be specified.
    - NFS export can be created only if access type of snapshot is "protocol".
    type: str

filesystem:
    description:
    - The ID/Name of the filesystem for which the NFS export will be created.
    - Either filesystem or snapshot is required for creation of the NFS Export.
    - If filesystem name is specified, then I(nas_server) is required to uniquely identify
      the filesystem.
    - If I(filesystem) parameter is provided, then I(snapshot) cannot be specified.
    type: str

host_state:
    choices:
    - present-in-export
    - absent-in-export
    description:
    - Define whether the hosts can access the NFS export.
    - Required when adding or removing host access from the export.
    type: str

is_no_suid:
    description:
    - If set, do not allow access to set SUID. Otherwise, allow access.
    - If not specified at the time of creation, it will be set to C(false).
    type: bool

nas_server:
    description:
    - The NAS server. This could be the name or ID of the NAS server.
    type: str

description:
    description:
    - The description for the NFS export.
    type: str

min_security:
    choices:
    - SYS
    - KERBEROS
    - KERBEROS_WITH_INTEGRITY
    - KERBEROS_WITH_ENCRYPTION
    description:
    - NFS enforced security type for users accessing an NFS export.
    - If not specified at the time of creation, it will be set to C(SYS).
    type: str

anonymous_gid:
    description:
    - Specifies the group ID of the anonymous account.
    - If not specified at the time of creation, it will be set to -2.
    type: int

anonymous_uid:
    description:
    - Specifies the user ID of the anonymous account.
    - If not specified at the time of creation, it will be set to -2.
    type: int

nfs_export_id:
    description:
    - The ID of the NFS export.
    type: str

default_access:
    choices:
    - NO_ACCESS
    - READ_ONLY
    - READ_WRITE
    - ROOT
    - READ_ONLY_ROOT
    description:
    - Default access level for all hosts that can access the Export.
    - For hosts that need different access than the default, they can be configured by
      adding to the list.
    - If I(default_access) is not mentioned during creation, then NFS export will be created
      with C(No_Access).
    type: str

validate_certs:
    aliases:
    - verifycert
    default: true
    description:
    - Boolean variable to specify whether to validate SSL certificate or not.
    - C(true) - indicates that the SSL certificate should be verified. Set the environment
      variable REQUESTS_CA_BUNDLE to the path of the SSL certificate.
    - C(false) - indicates that the SSL certificate should not be verified.
    type: bool

nfs_export_name:
    description:
    - The name of the NFS export.
    - Mandatory for create operation.
    - Specify either I(nfs_export_name) or I(nfs_export_id) but not both for any operation.
    type: str

no_access_hosts:
    description:
    - Hosts with no access to the NFS export.
    elements: str
    type: list

read_only_hosts:
    description:
    - Hosts with read-only access to the NFS export.
    elements: str
    type: list

read_write_hosts:
    description:
    - Hosts with read and write access to the NFS export.
    elements: str
    type: list

read_only_root_hosts:
    description:
    - Hosts with read-only access for root user to the NFS export.
    elements: str
    type: list

read_write_root_hosts:
    description:
    - Hosts with read and write access for root user to the NFS export.
    elements: str
    type: list

Outputs

changed:
  description: Whether or not the resource has changed.
  returned: always
  sample: 'false'
  type: bool
nfs_export_details:
  contains:
    anonymous_GID:
      description: The group ID of the anonymous account.
      type: int
    anonymous_UID:
      description: The user ID of the anonymous account.
      type: int
    default_access:
      description: Default access level for all hosts that can access the export.
      type: str
    description:
      description: The description for the NFS export.
      type: str
    file_system:
      contains:
        filesystem_type:
          description: The type of the filesystem.
          type: str
        id:
          description: The ID of the filesystem.
          type: str
        name:
          description: The name of the filesystem.
          type: str
        nas_server:
          contains:
            id:
              description: The ID of the NAS server.
              type: str
            name:
              description: The name of the NAS server.
              type: str
          description: Details of NAS server.
          type: complex
      description: Details of filesystem and NAS server on which NFS export is present.
      type: complex
    id:
      description: The ID of the NFS export.
      type: str
    is_no_SUID:
      description: If set, do not allow access to set SUID. Otherwise, allow access.
      type: bool
    min_security:
      description: NFS enforced security type for users accessing an NFS export.
      type: str
    name:
      description: The name of the NFS export.
      type: str
    no_access_hosts:
      description: Hosts with no access to the NFS export.
      type: list
    path:
      description: Local path to a location within the file system.
      type: str
    read_only_hosts:
      description: Hosts with read-only access to the NFS export.
      type: list
    read_only_root_hosts:
      description: Hosts with read-only for root user access to the NFS export.
      type: list
    read_write_hosts:
      description: Hosts with read and write access to the NFS export.
      type: list
    read_write_root_hosts:
      description: Hosts with read and write for root user access to the NFS export.
      type: list
  description: The NFS export details.
  returned: When NFS export exists.
  sample:
    anonymous_GID: -2
    anonymous_UID: -2
    default_access: No_Access
    default_access_l10n: No_Access
    description: null
    export_path: 10.xx.xx.xx:/sample_nfs_export
    file_system:
      filesystem_type: Primary
      id: 61d68815-1ac2-fc68-7263-96e8abdcbab0
      name: sample_file_system
      nas_server:
        id: 60c0564a-4a6e-04b6-4d5e-fe8be1eb93c9
        name: ansible_nas_server_2
    id: 61d6888b-52ed-0d4b-2b35-96e8abdcbab0
    is_no_SUID: false
    min_security: Sys
    min_security_l10n: Sys
    name: sample_nfs_export
    nfs_owner_username: 0
    no_access_hosts: []
    path: /sample_file_system
    read_only_hosts: []
    read_only_root_hosts: []
    read_write_hosts: []
    read_write_root_hosts: []
  type: complex