dellemc / dellemc.powerscale / 1.4.0 / module / dellemc_powerscale_nfs Manage NFS exports on a DellEMC PowerScale system | "added in version" 1.2.0 of dellemc.powerscale" Authors: Manisha Agrawal(@agrawm3) <ansible.team@dell.com> preview | supported by communitydellemc.powerscale.dellemc_powerscale_nfs (1.4.0) — module
Install with ansible-galaxy collection install dellemc.powerscale:==1.4.0
collections: - name: dellemc.powerscale version: 1.4.0
Managing NFS exports on an PowerScale system includes creating NFS export for a directory in an access zone, adding or removing clients, modifying different parameters of the export and deleting 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 description 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" 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: 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. - present indicates that the NFS export should exist in system. - 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 '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 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. - True - indicates that the SSL certificate should be verified. - 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. - present-in-export indicates that the clients can access the NFS export. - 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. required: false type: str 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 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 sub_directories_mountable: description: - 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: 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 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 type: complex changed: description: A boolean indicating if the task had to make changes. returned: always type: bool