huawei.enterprise.hw_enterprise_dtree module – Dtree 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_dtree.
Synopsis
Supports the provisioning operations on a Dtree such as create, modify, delete and get the details of a Dtree.
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. |
|
Parameter required for all query operations. The response will include the storage parameters that match the indicate filter criteria. Choices:
|
|
IP or FQDN of the huawei enterprise management system. MultiIP config as ip1,ip2 |
|
Dtree unique id, Mutually exclusive with “name”, Priority is higher than name. |
|
Dtree unique name, Required for create operation. Mutually exclusive with id. |
|
Dtree new unique name, Required for modify dtree name. |
|
ID of the parent file system object, Required for create, query, modify and delete operation. parent_id and parent_name are mutually exclusive. |
|
Name of the parent file system object, Required for create, query, modify and delete operation. parent_id and parent_name are mutually exclusive. |
|
The password of the PowerStore host. |
|
Quota switch, Optional parameters for create and modify operation, default false. Choices:
|
|
Security style supported by a dtree directory, Optional parameters for create and modify operation. default unix. Choices:
|
|
Huawei Enterprise Storage rest api Timeout time. Default: |
|
Define whether the Dtree 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 parent_id or parent_name param must be set.
The modules present in this collection named as ‘huawei.enterprise’ are built to support the Huawei Enterprise Storage System.
Examples
---
tasks:
- name: Create Dtree
register: dtree_info
huawei.enterprise.hw_enterprise_dtree:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< dtree_name >"
parent_id: "< fs_id >"
parent_name: "< fs_name >"
quota_switch: "< false | true >"
security_style: "< native | ntfs | unix | mixed >"
vstore_id: "< vstore_id >"
state: "present"
- name: Modify Dtree By ID
register: dtree_info
huawei.enterprise.hw_enterprise_dtree:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "< dtree_id >"
new_name: "< new_dtree_name >"
quota_switch: "< false | true >"
security_style: "< native | ntfs | unix | mixed >"
state: "present"
- name: Modify Dtree By Name
register: dtree_info
huawei.enterprise.hw_enterprise_dtree:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< dtree_name >"
new_name: "< new_dtree_name >"
parent_id: "< fs_id >"
parent_name: "< fs_name >"
quota_switch: "< false | true >"
security_style: "< native | ntfs | unix | mixed >"
vstore_id: "< vstore_id >"
state: "present"
- name: Query Dtree Detail By Name
register: dtree_info
huawei.enterprise.hw_enterprise_dtree:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
parent_id: "< fs_id >"
parent_name: "< fs_name >"
name: "< dtree_name >"
filter:
- id
- name
- vstore_name
- vstore_id
- parent_id
- quota_switch
- quota_switch_status
- security_style
vstore_id: "< vstore_id >"
state: "present"
- name: Query Dtree Detail By ID
register: dtree_info
huawei.enterprise.hw_enterprise_dtree:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "< dtree_id >"
filter:
- id
- name
- vstore_name
- vstore_id
- parent_id
- quota_switch
- quota_switch_status
- security_style
state: "present"
- name: Query Multi Dtree
register: all_dtree
huawei.enterprise.hw_enterprise_dtree:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
parent_id: "< fs_id >"
parent_name: "< fs_name >"
filter:
- id
- name
- vstore_name
- vstore_id
- parent_id
- quota_switch
- quota_switch_status
- security_style
vstore_id: "< vstore_id >"
state: "present"
- name: Delete Dtree By Name
huawei.enterprise.hw_enterprise_dtree:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< dtree_name >"
parent_id: "< fs_id >"
parent_name: "< fs_name >"
vstore_id: "< vstore_id >"
state: "absent"
- name: Delete Dtree By ID
huawei.enterprise.hw_enterprise_dtree:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ dtree_info.dtree_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 Dtree. Returned: When Dtree exists Sample: |
|
The system generated ID given to the Dtree. Returned: always |
|
Name of the Dtree. Returned: always |
|
FileSystem ID. Returned: always |
|
FileSystem name. Returned: always |
|
Quota switch of the Dtree. Returned: always |
|
Quota running status of the Dtree. Returned: always |
|
Security style supported by a dtree directory of the Dtree. Returned: always |
|
id of storage vstore. Returned: always |
|
Name of storage vstore. Returned: always |
|
task execute remark Returned: always Sample: |