huawei.enterprise.hw_enterprise_nfs_share_client module – NFS Share Client operations for Huawei Enterprise Storage

Note

This module is part of the huawei.enterprise collection (version 2.0.0).

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 huawei.enterprise. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: huawei.enterprise.hw_enterprise_nfs_share_client.

Synopsis

  • Create, delete, modify and get the detail of a Nfs Share Client

Requirements

The below requirements are needed on the host that executes this module.

  • Huawei Dorado v5/v6/v7 and OceanStor v5/v6/v7 Storage

Parameters

Parameter

Comments

access_val

string

NFS Share description

V5 Storage only support "read_only","read_write"

Choices:

  • "read_only"

  • "read_write"

  • "no_permission"

all_squash

string

Permission constraint.

Required when create NFS share client

Choices:

  • "all_squash"

  • "no_all_squash"

custom_vars

dictionary

Parameters used to extend those not currently supported by the module.

Configuration needs to be based on the REST API documentation for storage.

If necessary, you can contact the plugin technical support for assistance.

filter

list / elements=string

the returned param for query operation.

required for query operation

Choices:

  • "id"

  • "name"

  • "parent_id"

  • "vstore_id"

  • "vstore_name"

  • "share_name"

  • "access_val"

  • "all_squash"

  • "root_squash"

  • "sync"

  • "secure"

hostname

string / required

IP or FQDN of the huawei enterprise management system.

MultiIP config as ip1,ip2

id

string

NFS share client unique id, Mutually exclusive with “name”, Priority is higher than name.

name

string

NFS share client unique name, Mutually exclusive with id.

Client IP address, host name, or network group name.

Required when create NFS share client

parent_id

string

ID of the parent object.

Required when create NFS share client

Required when operate by Name

password

string / required

The password of the PowerStore host.

root_squash

string

root permission constraint.

required when create NFS share client

Choices:

  • "all_squash"

  • "no_root_squash"

secure

string

NFS Share Source Port Verification.

Choices:

  • "secure"

  • "insecure"

socket_timeout

integer

Huawei Enterprise Storage rest api Timeout time.

Default: 60

state

string / required

Define whether the NFS Share Client should exist or not.

Choices:

  • "absent"

  • "present"

storage_port

integer

Port number for the Huawei Enterprise array.

If not passed, it will take 8088 as default.

Default: 8088

sync

string

NFS Share Write Mode.

Choices:

  • "synchronization"

  • "asynchronous"

use_log

boolean

Whether to write plugin log to local filesystem.

Choices:

  • false ← (default)

  • true

username

string / required

The username of the PowerStore host.

valid_certs

string

The path of the SSL certificate variable to specify whether to validate SSL certificate or not.

If don’t set means no need to verify ssl cert.

vstore_id

string

id of storage vstore.

It defaults to 0:SystemVstore if not specified.

Notes

Note

  • The check_mode is not supported.

  • The sync parameter is mandatory for V5 storage create and modify operation.

  • The sync parameter is mandatory for V6 Storage and later versions is not supported.

  • The modules present in this collection named as ‘huawei.enterprise’ are built to support the Huawei Enterprise Storage System.

Examples

tasks:
  - name: Create NFS Share Client
    register: nfs_share_client_info
    huawei.enterprise.hw_enterprise_nfs_share_client:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      name: "< nfs_share_client_name >"
      parent_id: "< parent_id >"
      all_squash: "< all_squash | no_all_squash >"
      root_squash: "< root_squash | no_root_squash >"
      access_val: "< read_only | read_write | no_permission >"
      sync: "< synchronization | asynchronous >"
      secure: "< secure | insecure >"
      vstore_id: "< vstore_id >"
      state: "present"

  - name: Modify NFS Share Client By Name
    register: nfs_share_client_info
    huawei.enterprise.hw_enterprise_nfs_share_client:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      name: "< nfs_share_client_name >"
      parent_id: "< parent_id >"
      all_squash: "< all_squash | no_all_squash >"
      root_squash: "< root_squash | no_root_squash >"
      access_val: "< read_only | read_write | no_permission >"
      sync: "< synchronization | asynchronous >"
      secure: "< secure | insecure >"
      vstore_id: "< vstore_id >"
      state: "present"

  - name: Modify NFS Share Client By Id
    register: nfs_share_client_info
    huawei.enterprise.hw_enterprise_nfs_share_client:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      id: "{{ nfs_share_client_info.nfs_share_client_detail.id }}"
      all_squash: "< all_squash | no_all_squash >"
      root_squash: "< root_squash | no_root_squash >"
      access_val: "< read_only | read_write | no_permission >"
      sync: "< synchronization | asynchronous >"
      secure: "< secure | insecure >"
      vstore_id: "< vstore_id >"
      state: "present"

  - name: Query NFS Share Client Detail By Name
    register: nfs_share_client_info
    huawei.enterprise.hw_enterprise_nfs_share_client:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      name: "< nfs_share_client_name >"
      parent_id: "< parent_id >"
      vstore_id: "< vstore_id >"
      filter:
        - id
        - name
        - vstore_name
        - vstore_id
        - parent_id
        - share_name
        - access_val
        - all_squash
        - sync
        - secure
        - root_squash
      state: "present"

  - name: Query NFS Share Client Detail By Id
    register: nfs_share_client_info
    huawei.enterprise.hw_enterprise_nfs_share_client:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      id: "{{ nfs_share_client_info.nfs_share_client_detail.id }}"
      vstore_id: "< vstore_id >"
      filter:
        - id
        - name
        - vstore_name
        - vstore_id
        - parent_id
        - share_name
        - access_val
        - all_squash
        - sync
        - secure
        - root_squash
      state: "present"

  - name: Query Multi NFS Share
    register: all_nfs_share_client
    huawei.enterprise.hw_enterprise_nfs_share_client:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      vstore_id: "< vstore_id >"
      filter:
        - id
        - name
        - vstore_name
        - vstore_id
        - parent_id
        - share_name
        - access_val
        - all_squash
        - sync
        - secure
        - root_squash
      state: "present"

  - name: Delete NFS Share Client Detail By Name
    huawei.enterprise.hw_enterprise_nfs_share_client:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      name: "< nfs_share_client_name >"
      parent_id: "< parent_id >"
      vstore_id: "< vstore_id >"
      state: "absent"

  - name: Delete NFS Share Client Detail By Id
    huawei.enterprise.hw_enterprise_nfs_share_client:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      id: "{{ nfs_share_client_info.nfs_share_client_detail.id }}"
      vstore_id: "< vstore_id >"
      state: "absent"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

actions

list / elements=string

playbook action lists

Returned: always

Sample: ["create"]

changed

boolean

Whether or not the resource has changed.

Returned: always

Sample: false

nfs_share_client_detail

complex

Details of the NFS Share client.

Returned: When Nfs share client exists

Sample: {"access_val": "read_only", "all_squash": "all_squash", "id": "1", "name": "/sharepath21312", "parent_id": "1", "root_squash": "root_squash", "secure": "secure", "share_name": "/fs001", "sync": "synchronization", "vstore_id": "0", "vstore_name": "System_vStore"}

access_val

string

Permission.

Returned: success

all_squash

string

Permission constraint.

Returned: success

id

string

The system generated ID given to the Nfs Share.

Returned: success

name

string

Name of the Nfs Share Client.

Returned: success

parent_id

string

ID of the parent object.

Returned: success

root_squash

string

root permission constraint.

Returned: success

secure

string

root permission constraint.

Returned: success

share_name

string

NFS share name.

Returned: success

sync

string

Write Mode.

Returned: success

vstore_id

string

id of storage vstore.

Returned: always

vstore_name

string

Name of storage vstore.

Returned: always

remark

string

task execute remark

Returned: always

Sample: "sample_nfs_share_client create successfully"

Authors

  • Huawei eSDK Ansible Team