dellemc / dellemc.powerscale / 3.0.0 / module / nfs Manage NFS exports on a PowerScale Storage System | "added in version" 1.2.0 of dellemc.powerscale" Authors: Manisha Agrawal(@agrawm3) <ansible.team@dell.com>, Bhavneet Sharma(@Bhavneet-Sharma) <ansible.team@dell.com>, Trisha Datta(@trisha-dell) <ansible.team@dell.com>dellemc.powerscale.nfs (3.0.0) — module
Install with ansible-galaxy collection install dellemc.powerscale:==3.0.0
collections: - name: dellemc.powerscale version: 3.0.0
Managing NFS exports on an PowerScale system includes retrieving details of NFS export, creating NFS export in specified access zone, adding or removing clients, modifying and deleting NFS export.
- name: Create NFS Export dellemc.powerscale.nfs: onefs_host: "{{onefs_host}}" api_user: "{{api_user}}" api_password: "{{api_password}}" verify_ssl: "{{verify_ssl}}" path: "<path>" access_zone: "{{access_zone}}" read_only_clients: - "{{client1}}" - "{{client2}}" read_only: true clients: ["{{client3}}"] client_state: 'present-in-export' state: 'present'
- name: Get NFS Export dellemc.powerscale.nfs: onefs_host: "{{onefs_host}}" api_user: "{{api_user}}" api_password: "{{api_password}}" verify_ssl: "{{verify_ssl}}" path: "<path>" access_zone: "{{access_zone}}" state: 'present'
- name: Add a root client dellemc.powerscale.nfs: onefs_host: "{{onefs_host}}" api_user: "{{api_user}}" api_password: "{{api_password}}" verify_ssl: "{{verify_ssl}}" path: "<path>" access_zone: "{{access_zone}}" root_clients: - "{{client4}}" client_state: 'present-in-export' state: 'present'
- name: Set sub_directories_mountable flag to true dellemc.powerscale.nfs: onefs_host: "{{onefs_host}}" api_user: "{{api_user}}" api_password: "{{api_password}}" verify_ssl: "{{verify_ssl}}" path: "<path>" access_zone: "{{access_zone}}" sub_directories_mountable: true state: 'present'
- name: Remove a root client dellemc.powerscale.nfs: onefs_host: "{{onefs_host}}" api_user: "{{api_user}}" api_password: "{{api_password}}" verify_ssl: "{{verify_ssl}}" path: "<path>" access_zone: "{{access_zone}}" root_clients: - "{{client4}}" client_state: 'absent-in-export' state: 'present'
- name: Modify NFS Export dellemc.powerscale.nfs: onefs_host: "{{onefs_host}}" api_user: "{{api_user}}" api_password: "{{api_password}}" verify_ssl: "{{verify_ssl}}" path: "<path>" access_zone: "{{access_zone}}" description: "new description" security_flavors: - "kerberos_integrity" - "kerberos" state: 'present'
- name: Set read_only flag to false dellemc.powerscale.nfs: onefs_host: "{{onefs_host}}" api_user: "{{api_user}}" api_password: "{{api_password}}" verify_ssl: "{{verify_ssl}}" path: "<path>" access_zone: "{{access_zone}}" read_only: false state: 'present'
- name: Modify map_root and map_non_root dellemc.powerscale.nfs: onefs_host: "{{onefs_host}}" api_user: "{{api_user}}" api_password: "{{api_password}}" verify_ssl: "{{verify_ssl}}" path: "<path>" access_zone: "{{access_zone}}" map_root: user: "root" primary_group: "root" map_non_root: user: "root" primary_group: "root" secondary_groups: - name: "group_test" state: "absent" state: 'present'
- name: Disable map_root dellemc.powerscale.nfs: onefs_host: "{{onefs_host}}" api_user: "{{api_user}}" api_password: "{{api_password}}" verify_ssl: "{{verify_ssl}}" path: "<path>" access_zone: "{{access_zone}}" map_root: enabled: false state: 'present'
- name: Delete NFS Export dellemc.powerscale.nfs: onefs_host: "{{onefs_host}}" api_user: "{{api_user}}" api_password: "{{api_password}}" verify_ssl: "{{verify_ssl}}" path: "<path>" access_zone: "{{access_zone}}" state: 'absent'
path: description: - Specifies the filesystem path. It is the absolute path for System access zone and it is relative if using non-system access zone. - For example, if your access zone is 'Ansible' and it has a base path '/ifs/ansible' and the path specified is '/user1', then the effective path would be '/ifs/ansible/user1'. - If your access zone is System, and you have 'directory1' in the access zone, the path provided should be '/ifs/directory1'. - The directory on the path must exist - the NFS module will not create the directory. - Ansible module will only support exports with a unique path. - If there are multiple exports present with the same path, fetching details, creation, modification or deletion of such exports will fail. required: true type: str state: choices: - absent - present description: - Defines whether the NFS export should exist or not. - Value C(present) indicates that the NFS export should exist in system. - Value C(absent) indicates that the NFS export should not exist in system. required: true type: str clients: description: - Specifies the clients to the export. The type of access to clients in this list is determined by the I(read_only) parameter. - This list can be changed anytime during the lifetime of the NFS export. elements: str type: list port_no: default: '8080' description: - Port number of the PowerScale cluster.It defaults to 8080 if not specified. required: false type: str api_user: description: - username of the PowerScale cluster. required: true type: str map_root: description: - Specifies the users and groups to which non-root and root clients are mapped. suboptions: enabled: default: true description: - True if the user mapping is applied. type: bool primary_group: description: - Specifies the primary group name. type: str secondary_groups: description: - Specifies the secondary groups. elements: dict suboptions: name: description: - Specifies the group name. required: true type: str state: choices: - absent - present default: present description: - Specifies the group state. type: str type: list user: description: - Specifies the persona name. type: str type: dict read_only: description: - Specifies whether the export is read-only or read-write. This parameter only has effect on the 'clients' list and not the other three types of clients. - This setting can be modified any time. If it is not set at the time of creation, the export will be of type read/write. type: bool onefs_host: description: - IP address or FQDN of the PowerScale cluster. required: true type: str verify_ssl: choices: - true - false description: - boolean variable to specify whether to validate SSL certificate or not. - C(true) - indicates that the SSL certificate should be verified. - C(false) - indicates that the SSL certificate should not be verified. required: true type: bool access_zone: default: System description: - Specifies the zone in which the export is valid. - Access zone once set cannot be changed. type: str description: description: - Optional description field for the NFS export. - Can be modified by passing a new value. type: str api_password: description: - the password of the PowerScale cluster. required: true type: str client_state: choices: - present-in-export - absent-in-export description: - Defines whether the clients can access the NFS export. - Value C(present-in-export) indicates that the clients can access the NFS export. - Value C(absent-in-export) indicates that the client cannot access the NFS export. - Required when adding or removing access of clients from the export. - While removing clients, only the specified clients will be removed from the export, others will remain as is. type: str map_non_root: description: - Specifies the users and groups to which non-root and root clients are mapped. suboptions: enabled: default: true description: - True if the user mapping is applied. type: bool primary_group: description: - Specifies the primary group name. type: str secondary_groups: description: - Specifies the secondary groups. elements: dict suboptions: name: description: - Specifies the group name. required: true type: str state: choices: - absent - present default: present description: - Specifies the group state. type: str type: list user: description: - Specifies the persona name. type: str type: dict root_clients: description: - Specifies the clients with root access to the export. - This list can be changed anytime during the lifetime of the NFS export. elements: str type: list security_flavors: choices: - unix - kerberos - kerberos_integrity - kerberos_privacy description: - Specifies the authentication types that are supported for this export. elements: str type: list read_only_clients: description: - Specifies the clients with read-only access to the export, even when the export is read/write. - This list can be changed anytime during the lifetime of the NFS export. elements: str type: list read_write_clients: description: - Specifies the clients with both read and write access to the export, even when the export is set to read-only. - This list can be changed anytime during the lifetime of the NFS export. elements: str type: list ignore_unresolvable_hosts: description: - Does not present an error condition on unresolvable hosts when creating or modifying an export. type: bool sub_directories_mountable: description: - C(true) if all directories under the specified paths are mountable. If not set, sub-directories will not be mountable. - This setting can be modified any time. type: bool
NFS_export_details: contains: all_dirs: description: I(sub_directories_mountable) flag value. type: bool clients: description: The list of clients for the NFS Export. sample: - client_ip - client_ip type: list description: description: Description for the export. type: str id: description: The ID of the NFS Export, generated by the array. sample: 12 type: int map_non_root: contains: enabled: description: True if the user mapping is applied. type: bool primary_group: contains: id: description: Specifies the primary group name. type: str description: Specifies the primary group details. type: complex secondary_groups: description: Specifies the secondary groups details. type: list user: contains: id: description: Specifies the persona name. type: str description: Specifies the persona details. type: complex description: Specifies the users and groups to which non-root and root clients are mapped. type: complex map_root: contains: enabled: description: True if the user mapping is applied. type: bool primary_group: contains: id: description: Specifies the primary group name. type: str description: Specifies the primary group. type: complex secondary_groups: description: Specifies the secondary groups. type: list user: contains: id: description: Specifies the persona name. type: str description: Specifies the persona name. type: complex description: Specifies the users and groups to which non-root and root clients are mapped. type: complex paths: description: The filesystem path. sample: - /ifs/dir/filepath type: list read_only: description: Specifies whether the export is read-only or read-write. type: bool read_only_clients: description: The list of read only clients for the NFS Export. sample: - client_ip - client_ip type: list read_write_clients: description: The list of read write clients for the NFS Export. sample: - client_ip - client_ip type: list root_clients: description: The list of root clients for the NFS Export. sample: - client_ip - client_ip type: list zone: description: Specifies the zone in which the export is valid. sample: System type: str description: The updated NFS Export details. returned: always sample: all_dir: 'false' block_size: 8192 clients: None id: 9324 map_non_root: enabled: false primary_group: id: null name: null type: null secondary_groups: [] user: id: USER:nobody name: null type: null map_root: enabled: true primary_group: id: GROUP:group1 name: null type: null secondary_groups: [] user: id: USER:user name: null type: null read_only_client: - x.x.x.x security_flavors: - unix - krb5 zone: System type: complex changed: description: A boolean indicating if the task had to make changes. returned: always sample: 'false' type: bool