huawei.enterprise.hw_enterprise_cifs_share module – CIFS Share 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_cifs_share.
Synopsis
Create, delete, modify and get the detail of a CIFS Share
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 |
|---|---|
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. |
|
CIFS Share description. |
|
Dtree ID. |
|
Parameter required for all query operations. The response will include the storage parameters that match the indicate filter criteria. Choices:
|
|
File system ID. |
|
IP or FQDN of the huawei enterprise management system. MultiIP config as ip1,ip2 |
|
CIFS share unique id, Mutually exclusive with “name”, Priority is higher than name. |
|
CIFS share unique name, Mutually exclusive with id. |
|
The password of the PowerStore host. |
|
Share path. Required when create CIFS Share. /file_system_name or /file_system_name/dtree_name. |
|
Huawei Enterprise Storage rest api Timeout time. Default: |
|
Define whether the CIFS share should exist or not. Choices:
|
|
Port number for the Huawei Enterprise array. If not passed, it will take 8088 as default. Default: |
|
Whether to write plugin log to local filesystem. Choices:
|
|
The username of the PowerStore host. |
|
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. |
|
id of storage vstore. It defaults to 0:SystemVstore if not specified. |
Notes
Note
The check_mode 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 CIFS Share
register: cifs_share_info
huawei.enterprise.hw_enterprise_cifs_share:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< cifs_share_name >"
share_path: "< cifs_share_path >"
fs_id: "< fs_id >"
dtree_id: "< dtree_id >"
description: "< description >"
vstore_id: "< vstore_id >"
state: "present"
- name: Modify CIFS Share By Name
register: cifs_share_info
huawei.enterprise.hw_enterprise_cifs_share:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< cifs_share_name >"
description: "< description >"
vstore_id: "< vstore_id >"
state: "present"
- name: Modify CIFS Share By Id
register: cifs_share_info
huawei.enterprise.hw_enterprise_cifs_share:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ cifs_share_info.cifs_share_detail.id }}"
description: "< description >"
vstore_id: "< vstore_id >"
state: "present"
- name: Query CIFS Share By Name
register: cifs_share_info
huawei.enterprise.hw_enterprise_cifs_share:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< cifs_share_name >"
filter:
- id
- share_path
- vstore_name
- vstore_id
- fs_id
- dtree_id
- name
vstore_id: "< vstore_id >"
state: "present"
- name: Query CIFS Share By Id
register: cifs_share_info
huawei.enterprise.hw_enterprise_cifs_share:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ cifs_share_info.cifs_share_detail.id }}"
filter:
- id
- share_path
- vstore_name
- vstore_id
- fs_id
- dtree_id
- name
vstore_id: "< vstore_id >"
state: "present"
- name: Query Multi CIFS Share
register: all_cifs_share
huawei.enterprise.hw_enterprise_cifs_share:
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:
- share_path
- vstore_name
- vstore_id
- fs_id
- dtree_id
- name
state: "present"
- name: Delete CIFS Share By Name
huawei.enterprise.hw_enterprise_cifs_share:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< cifs_share_name >"
vstore_id: "< vstore_id >"
state: "absent"
- name: Delete CIFS Share By Id
huawei.enterprise.hw_enterprise_cifs_share:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ cifs_share_info.cifs_share_detail.id }}"
state: "absent"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
playbook action lists Returned: always Sample: |
|
Whether or not the resource has changed. Returned: always Sample: |
|
Details of the CIFS share. Returned: When CIFS share exists Sample: |
|
Dtree ID. Returned: success |
|
File system ID. Returned: success |
|
The system generated ID given to the CIFS Share. Returned: success |
|
Name of the CIFS Share. Returned: success |
|
Share path. Returned: success |
|
id of storage vstore. Returned: always |
|
Name of storage vstore. Returned: always |
|
task execute remark Returned: always Sample: |
Authors
Huawei eSDK Ansible Team