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

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.

description

string

USER server description

filter

list / elements=string

Parameter required for all query operations.

The response will include the storage parameters that match the indicate filter criteria.

Choices:

  • "role"

  • "is_online"

  • "account_state"

  • "name"

  • "id"

  • "user_group_name"

  • "lock_status"

hostname

string / required

IP or FQDN of the huawei enterprise management system.

MultiIP config as ip1,ip2

id

string

USER server unique id, Mutually exclusive with “name”, Priority is higher than name.

name

string

USER server unique name, Mutually exclusive with id.

password

string / required

The password of the PowerStore host.

role

string

User role.

Choices:

  • "administrator"

  • "security administrator"

  • "SAN administrator"

  • "NAS administrator"

  • "Data protection administrator"

  • "empty role"

  • "remote device administrator"

  • "monitor"

  • "NDMP backup administrator"

  • "vstore administrator"

scope

string

USER type.

Choices:

  • "local_user"

  • "ldap_user"

  • "ldap_group"

  • "radius_user"

socket_timeout

integer

Huawei Enterprise Storage rest api Timeout time.

Default: 60

state

string / required

Define whether the USER server 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

super_administrator_password

string

Super administrator password.

Required when Initial USER Password

Password parameter must set at /home/secrets.yml

use_log

boolean

Whether to write plugin log to local filesystem.

Choices:

  • false ← (default)

  • true

user_new_password

string

USER server password.

Required when Modify USER Password or Initial USER Password

user_password

string

USER server password.

Optional when create, modify USER server

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.

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

actions

list / elements=string

playbook action lists

Returned: always

Sample: ["create"]

changed

boolean

Whether or not the resource has changed.

Returned: always

Sample: false

remark

string

task execute remark

Returned: always

Sample: "sample_user_server create successfully"

user_detail

complex

Details of the USER Server.

Returned: When USER Server exists

Sample: {"account_state": "normal", "id": "admin_123", "is_online": "online", "lock_status": "locked", "name": "admin_1231", "role": "administrator", "type": "USER", "user_group_name": "na123"}

account_state

string

Password status.

Returned: success

id

string

User ID.

Returned: success

is_online

string

Online status.

Returned: success

lock_status

string

Lock status.

Returned: success

name

string

User NAME.

Returned: success

role

string

User Role.

Returned: success

type

string

Object type.

Returned: success

user_group_name

string

Owning LDAP group.

Returned: success

Authors

  • Huawei eSDK Ansible Team