dellemc.openmanage.idrac_user 模块 – 配置用户账户设置

注意

此模块是 dellemc.openmanage 集合(版本 9.9.0)的一部分。

如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用: ansible-galaxy collection install dellemc.openmanage。您需要满足其他要求才能使用此模块,请参阅 要求 了解详细信息。

要在 playbook 中使用它,请指定:dellemc.openmanage.idrac_user

dellemc.openmanage 2.1.0 中的新增功能

概要

  • 此模块允许执行以下操作:

  • 添加新的用户帐户。

  • 编辑用户帐户。

  • 启用或禁用用户帐户。

要求

执行此模块的主机需要以下要求:

  • python >= 3.9.6

参数

参数

注释

authentication_protocol

字符串

此选项允许配置以下身份验证协议类型之一来验证 iDRAC 用户。

安全散列算法 SHA

消息摘要 5 MD5

如果选择 None,则不配置身份验证协议。

选项

  • "None"

  • "SHA"

  • "MD5"

ca_path

路径

在 dellemc.openmanage 5.0.0 中添加

包含要用于验证的 CA 证书的隐私增强邮件 (PEM) 文件。

custom_privilege

整数

在 dellemc.openmanage 8.1.0 中添加

分配给用户的权限级别。

enable

布尔值

提供启用或禁用用户登录 iDRAC 的选项。

选项

  • false

  • true

idrac_ip

字符串 / 必需

iDRAC IP 地址。

idrac_password

别名:idrac_pwd

字符串

iDRAC 用户密码。

如果未提供密码,则使用环境变量 IDRAC_PASSWORD

示例:export IDRAC_PASSWORD=password

idrac_port

整数

iDRAC 端口。

默认值: 443

idrac_user

字符串

iDRAC 用户名。

如果未提供用户名,则使用环境变量 IDRAC_USERNAME

示例:export IDRAC_USERNAME=username

ipmi_lan_privilege

字符串

分配给用户的智能平台管理接口 LAN 权限级别。

选项

  • "管理员"

  • "操作员"

  • "用户"

  • "无 访问权限"

ipmi_serial_privilege

字符串

分配给用户的智能平台管理接口串行端口权限级别。

此选项仅适用于机架式和塔式服务器。

选项

  • "管理员"

  • "操作员"

  • "用户"

  • "无 访问权限"

new_user_name

字符串

提供要修改的帐户的 user_name

privacy_protocol

字符串

此选项允许为 iDRAC 用户配置以下隐私加密协议之一。

数据加密标准 DES

高级加密标准 AES

如果选择 None,则不配置隐私协议。

选项

  • "None"

  • "DES"

  • "AES"

privilege

字符串

以下是基于角色的权限。

具有 Administrator 权限的用户可以登录 iDRAC,然后配置 iDRAC、配置用户、清除日志、控制和配置系统、访问虚拟控制台、访问虚拟介质、测试警报以及执行调试命令。

具有 Operator 权限的用户可以登录 iDRAC,然后配置 iDRAC、控制和配置系统、访问虚拟控制台、访问虚拟介质以及执行调试命令。

具有 ReadOnly 权限的用户只能登录 iDRAC。

具有 None 的用户,没有分配任何权限。

如果提供了 custom_privilege 参数,则将被忽略。

选项

  • "管理员"

  • "ReadOnly"

  • "操作员"

  • "None"

protocol_enable

布尔值

为 iDRAC 用户启用协议。

选项

  • false

  • true

sol_enable

布尔值

为 iDRAC 用户启用串行 over LAN (SOL)。

选项

  • false

  • true

state

字符串

选择 present 来创建或修改用户帐户。

选择 absent 来删除用户帐户。

选项

  • "present" ←(默认)

  • "absent"

timeout

整数

在 dellemc.openmanage 5.0.0 中添加

套接字级别的超时时间,以秒为单位。

默认值: 30

user_name

字符串 / 必需

提供要创建、删除或修改的帐户的 user_name

user_password

字符串

提供用户帐户的密码。用户帐户被修改时可以更改密码。

为了确保安全,user_password 必须至少包含八个字符,并且必须包含小写和大写字符、数字和特殊字符。

validate_certs

布尔值

在 dellemc.openmanage 5.0.0 中添加

如果为 false,则不会验证 SSL 证书。

仅在个人控制的使用自签名证书的站点上配置 false

在集合版本 5.0.0 之前,validate_certs 默认值为 false

选项

  • false

  • true ← (默认)

x_auth_token

字符串

在 dellemc.openmanage 9.3.0 中添加

身份验证令牌。

如果未提供 x_auth_token,则使用环境变量 IDRAC_X_AUTH_TOKEN

示例:export IDRAC_X_AUTH_TOKEN=x_auth_token

注释

注意

  • 从可以直接访问 Dell iDRAC 的系统运行此模块。

  • 此模块支持 check_mode

示例

---
- name: Configure a new iDRAC user
  dellemc.openmanage.idrac_user:
    idrac_ip: 198.162.0.1
    idrac_user: idrac_user
    idrac_password: idrac_password
    ca_path: "/path/to/ca_cert.pem"
    state: present
    user_name: user_name
    user_password: user_password
    privilege: Administrator
    ipmi_lan_privilege: Administrator
    ipmi_serial_privilege: Administrator
    enable: true
    sol_enable: true
    protocol_enable: true
    authentication_protocol: SHA
    privacy_protocol: AES

- name: Modify existing iDRAC user username and password
  dellemc.openmanage.idrac_user:
    idrac_ip: 198.162.0.1
    idrac_user: idrac_user
    idrac_password: idrac_password
    ca_path: "/path/to/ca_cert.pem"
    state: present
    user_name: user_name
    new_user_name: new_user_name
    user_password: user_password

- name: Delete existing iDRAC user account
  dellemc.openmanage.idrac_user:
    idrac_ip: 198.162.0.1
    idrac_user: idrac_user
    idrac_password: idrac_password
    ca_path: "/path/to/ca_cert.pem"
    state: absent
    user_name: user_name

返回值

常见的返回值已在此处记录 这里,以下是此模块独有的字段

描述

error_info

字典

HTTP 错误的详细信息。

返回:在 HTTP 错误时

示例: {"error": {"@Message.ExtendedInfo": [{"Message": "由于发生错误,无法处理请求。", "MessageArgs": [], "MessageId": "GEN1234", "RelatedProperties": [], "Resolution": "重试操作。如果问题仍然存在,请联系系统管理员。", "Severity": "Critical"}], "code": "Base.1.0.GeneralError", "message": "发生了一个通用错误。有关更多信息,请参见 ExtendedInfo。"}}

msg

字符串

iDRAC 用户配置的状态。

返回:始终

示例: "成功创建用户帐户详细信息。"

status

字典

配置 iDRAC 用户属性。

返回:成功

示例: {"@Message.ExtendedInfo": [{"Message": "成功完成请求", "MessageArgs": [], "[email protected]": 0, "MessageId": "Base.1.5.Success", "RelatedProperties": [], "[email protected]": 0, "Resolution": "无", "Severity": "OK"}, {"Message": "操作成功完成。", "MessageArgs": [], "[email protected]": 0, "MessageId": "IDRAC.2.1.SYS413", "RelatedProperties": [], "[email protected]": 0, "Resolution": "不需要任何响应操作。", "Severity": "Informational"}]}

作者

  • Felix Stephen (@felixs88)