huawei.enterprise.hw_enterprise_user_server module – USER server 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_user_server.
Synopsis
Create, delete, modify and get the detail of a USER server
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. |
|
USER server description |
|
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 |
|
USER server unique id, Mutually exclusive with “name”, Priority is higher than name. |
|
USER server unique name, Mutually exclusive with id. |
|
The password of the PowerStore host. |
|
User role. Choices:
|
|
USER type. Choices:
|
|
Huawei Enterprise Storage rest api Timeout time. Default: |
|
Define whether the USER server should exist or not. Choices:
|
|
Port number for the Huawei Enterprise array. If not passed, it will take 8088 as default. Default: |
|
Super administrator password. Required when Initial USER Password Password parameter must set at /home/secrets.yml |
|
Whether to write plugin log to local filesystem. Choices:
|
|
USER server password. Required when Modify USER Password or Initial USER Password |
|
USER server password. Optional when create, modify USER server |
|
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. This parameter must be delivered in vStore scenarios. |
Notes
Note
The check_mode is not supported.
Super administrator can modify their own password and the information of other USER.
Super administrator can not modify other USER’s password.
Other USER can only modify their own password.
The user description, role, and password cannot be modified at same time.
The modules present in this collection named as ‘huawei.enterprise’ are built to support the Huawei Enterprise Storage System.
Examples
tasks:
- name: Create User Service
register: user_info
huawei.enterprise.hw_enterprise_user_server:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
user_password: "{{ user_password }}"
name: "< name >"
scope: "< local_user | ldap_user | ldap_group | radius_user >"
role: "< role >"
description: "< description >"
vstore_id: "< vstore_id >"
state: "present"
- name: Modify User Service By Id
register: user_info
huawei.enterprise.hw_enterprise_user_server:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ user_info.user_detail.id }}"
user_new_password: "{{ user_new_password }}"
user_password: "{{ user_old_password }}"
role: "< role >"
description: "< description >"
vstore_id: "< vstore_id >"
state: "present"
- name: Get User Server By Id
register: user_info
huawei.enterprise.hw_enterprise_user_server:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ user_info.user_detail.id }}"
state: "present"
filter:
- role
- is_online
- account_state
- name
- id
- user_group_name
- scope
- lock_status
- name: Query Multi User Server
register: query_multi_user
huawei.enterprise.hw_enterprise_user_server:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
state: "present"
vstore_id: "< vstore_id >"
filter:
- role
- is_online
- account_state
- name
- id
- user_group_name
- scope
- lock_status
- name: Delete User Server By Id
huawei.enterprise.hw_enterprise_user_server:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ user_info.user_detail.id }}"
vstore_id: "< vstore_id >"
state: "absent"
- name: Initial User Password
register: user_info
huawei.enterprise.hw_enterprise_user_server:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ user_info.user_detail.id }}"
user_new_password: "{{ user_new_password }}"
super_administrator_password: "{{ super_administrator_password }}"
vstore_id: "< vstore_id >"
state: "present"
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: |
|
task execute remark Returned: always Sample: |
|
Details of the USER Server. Returned: When USER Server exists Sample: |
|
Password status. Returned: success |
|
User ID. Returned: success |
|
Online status. Returned: success |
|
Lock status. Returned: success |
|
User NAME. Returned: success |
|
User Role. Returned: success |
|
Object type. Returned: success |
|
Owning LDAP group. Returned: success |