huawei.enterprise.hw_enterprise_ldap_server module – IDAP Service 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_ldap_server.

Synopsis

  • Create, modify, get, delete and test the detail of IDAP Service

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

base_dn

string

Base DN.

bind_dn

string

Bind DN.

bind_password

string

Bind password.

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"

  • "base_dn"

  • "bind_dn"

  • "directory_type"

  • "transfer_type"

  • "user_id_attr"

  • "user_name_attr"

  • "user_object_class"

  • "user_search_path"

  • "group_name_attr"

  • "group_id_attr"

  • "group_member_attr"

  • "group_object_class"

  • "group_search_path"

  • "server_ip"

  • "port"

group_id_attr

string

Group ID attribute.

hostname

string / required

IP or FQDN of the huawei enterprise management system.

MultiIP config as ip1,ip2

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 IDAP 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

transfer_type

string

Underlying communication protocol type.

Choices:

  • "ldap"

  • "ldaps"

use_log

boolean

Whether to write plugin log to local filesystem.

Choices:

  • false ← (default)

  • true

user_id_attr

string

User ID attribute.

user_name_attr

string

User name attribute.

user_object_class

string

User object type.

user_search_path

string

User directory.

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 LDAP Service
    register: ldap_info
    huawei.enterprise.hw_enterprise_ldap_server:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      bind_password: "{{ bind_password }}"
      use_log: "{{ use_log }}"
      base_dn: "< base_dn >"
      bind_dn: "< bind_dn >"
      directory_type: "< ldap | ad >"
      transfer_type: "< ldap | ldaps >"
      user_id_attr: "< user_id_attr >"
      user_name_attr: "< user_name_attr >"
      user_object_class: "< user_object_class >"
      user_search_path: "< user_search_path >"
      group_id_attr: "< group_id_attr >"
      state: "present"

  - name: Modify LDAP Service
    register: ldap_info
    huawei.enterprise.hw_enterprise_ldap_server:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      bind_password: "{{ bind_password }}"
      base_dn: "< base_dn >"
      bind_dn: "< bind_dn >"
      directory_type: "< ldap | ad >"
      transfer_type: "< ldap | ldaps >"
      user_id_attr: "< user_id_attr >"
      user_name_attr: "< user_name_attr >"
      user_object_class: "< user_object_class >"
      user_search_path: "< user_search_path >"
      group_id_attr: "< group_id_attr >"
      state: "present"

  - name: Get LDAP server
    register: ldap_info
    huawei.enterprise.hw_enterprise_ldap_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"
      filter:
        - id
        - base_dn
        - bind_dn
        - directory_type
        - transfer_type
        - user_id_attr
        - user_name_attr
        - user_object_class
        - user_search_path
        - group_name_attr
        - group_member_attr
        - group_object_class
        - group_search_path

  - name: Delete LDAP server
    huawei.enterprise.hw_enterprise_ldap_server:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      state: "absent"

  - name: Test LDAP Service
    register: ldap_info
    huawei.enterprise.hw_enterprise_ldap_server:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      bind_password: "{{ bind_password }}"
      use_log: "{{ use_log }}"
      operation: "test"
      base_dn: "< base_dn >"
      bind_dn: "< bind_dn >"
      directory_type: "< ldap | ad >"
      transfer_type: "< ldap | ldaps >"
      server_ip: "< server_ip >"
      port: "< port >"
      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

ldap_server_detail

complex

Details of the LDAP Server.

Returned: When host exists

Sample: {"base_dn": "cn=My Application,ou=applications,dc=com", "bind_dn": "cn=My Application,ou=applications,dc=com", "directory_type": "ldap", "group_id_attr": "uSNCreated", "group_member_attr": "member", "group_name_attr": "sAMAccountName", "group_object_class": "group", "group_search_path": "", "transfer_type": "ldap", "user_id_attr": "uSNCreated", "user_name_attr": "sAMAccountName", "user_object_class": "user", "user_search_path": "ou=applications,dc=com"}

base_dn

string

Base DN.

Returned: success

bind_dn

string

Bind DN.

Returned: success

directory_type

string

LDAP directory type.

Returned: success

group_id_attr

string

Group id attribute.

Returned: success

group_member_attr

string

Group member attribute.

Returned: success

group_name_attr

string

Group name attribute.

Returned: success

group_object_class

string

Group object type.

Returned: success

group_search_path

string

Group directory.

Returned: success

transfer_type

string

Underlying communication protocol type.

Returned: success

user_id_attr

string

User ID attribute.

Returned: success

user_name_attr

string

User name attribute.

Returned: success

user_object_class

string

User object type.

Returned: success

user_search_path

string

User directory.

Returned: success

remark

string

task execute remark

Returned: always

Sample: "sample_ldap_service create successfully"

Authors

  • Huawei eSDK Ansible Team