huawei.enterprise.hw_enterprise_usm_user module – Usm user 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_usm_user.

Synopsis

  • Supports the provisioning operations on a Usm user such as create, modify, delete and get the details of a Usm user.

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

cmo_usm_auth_prot

string

Authentication protocol type, create operation is required, while modification operation is optional.

Choices:

  • "md5"

  • "none"

  • "sha"

  • "sha224"

  • "sha256"

  • "sha384"

  • "sha512"

cmo_usm_passwd

string

Authentication password.

This field must be delivered when the value of cmo_usm_auth_prot is not “none”.

cmo_usm_priv_passwd

string

Data encryption password.

This field must be delivered when the value of cmo_usm_priv_prot is not “none”.

cmo_usm_priv_prot

string

Data encryption protocol type, create operation is required, while modification operation is optional.

Choices:

  • "none"

  • "des"

  • "3des"

  • "aes128"

  • "aes192"

  • "aes256"

cmo_usm_user

string

Usm user unique name, create operation is required, while modification operation is optional. Mutually exclusive with id.

cmo_usm_user_level

string

User level, create operation is required, while modification operation is optional.

Choices:

  • "read_and_write"

  • "read_only"

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

Parameter required for all query operations.

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

Choices:

  • "id"

  • "cmo_usm_user"

  • "type"

  • "cmo_usm_auth_prot"

  • "cmo_usm_is_default"

  • "cmo_usm_priv_prot"

  • "cmo_usm_user_level"

hostname

string / required

IP or FQDN of the huawei enterprise management system.

MultiIP config as ip1,ip2

id

string

Usm user unique id, Mutually exclusive with “name”, Priority is higher than name.

password

string / required

The password of the PowerStore host.

socket_timeout

integer

Huawei Enterprise Storage rest api Timeout time.

Default: 60

state

string / required

Define whether the Usm user 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

type

string

Type number of the managed object, Required for create operation.

Choices:

  • "snmp_usm"

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.

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 Usm User
      register: usm_user_info
      huawei.enterprise.hw_enterprise_usm_user:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        cmo_usm_auth_prot: "< md5 | none | sha | sha224 | sha256 | sha384 | sha512 >"
        cmo_usm_priv_prot: "< none | des | 3des | aes128 | aes192 | aes256 >"
        cmo_usm_user: "< cmo_usm_user >"
        cmo_usm_passwd: "{{ cmo_usm_passwd }}"
        cmo_usm_priv_passwd: "{{ cmo_usm_priv_passwd }}"
        cmo_usm_user_level: "< read_and_write | read_only >"
        type: "snmp_usm"
        state: "present"

    - name: Modify Usm User By Id
      register: usm_user_info
      huawei.enterprise.hw_enterprise_usm_user:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "{{ usm_user_info.usm_user_detail.id }}"
        cmo_usm_auth_prot: "< md5 | none | sha | sha224 | sha256 | sha384 | sha512 >"
        cmo_usm_priv_prot: "< none | des | 3des | aes128 | aes192 | aes256 >"
        cmo_usm_passwd: "{{ cmo_usm_passwd }}"
        cmo_usm_priv_passwd: "{{ cmo_usm_priv_passwd }}"
        cmo_usm_user_level: "< read_and_write | read_only >"
        state: "present"

    - name: Query Multi Usm User
      register: usm_user_info
      huawei.enterprise.hw_enterprise_usm_user:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        state: "present"
        filter:
          - type
          - id
          - cmo_usm_auth_prot
          - cmo_usm_is_default
          - cmo_usm_priv_prot
          - cmo_usm_user
          - cmo_usm_user_level

    - name: Get Usm User By Id
      register: usm_user_info
      huawei.enterprise.hw_enterprise_usm_user:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "{{ usm_user_info.usm_user_detail.id }}"
        state: "present"
        filter:
          - type
          - id
          - cmo_usm_auth_prot
          - cmo_usm_is_default
          - cmo_usm_priv_prot
          - cmo_usm_user
          - cmo_usm_user_level

    - name: Delete Usm User By Id
      huawei.enterprise.hw_enterprise_usm_user:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "{{ usm_user_info.usm_user_detail.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

remark

string

task execute remark

Returned: always

Sample: "Usm user sample_usm_user create successfully"

usm_user_detail

complex

Details of the Usm User.

Returned: When Usm User exists

Sample: {"cmo_usm_auth_prot": "sha", "cmo_usm_is_default": "false", "cmo_usm_priv_prot": "des", "cmo_usm_user": "sample_usm_user", "cmo_usm_user_level": "read_and_write", "id": "1"}

cmo_usm_auth_prot

string

Authentication protocol type.

Returned: always

cmo_usm_is_default

string

Whether the USM user is a default user.

Returned: always

cmo_usm_priv_prot

string

Authentication protocol type.

Returned: always

cmo_usm_user

string

Name of the Usm User.

Returned: always

cmo_usm_user_level

string

User level.

Returned: always

id

string

The system generated ID given to the Usm User.

Returned: always

Authors

  • Huawei eSDK Ansible Team