dellemc.openmanage.idrac_reset 模块 – 将 iDRAC 重置为出厂设置

注意

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

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

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

要在剧本中使用它,请指定:dellemc.openmanage.idrac_reset

dellemc.openmanage 2.1.0 中的新增功能

概要

  • 此模块将 iDRAC 重置为出厂默认设置。

要求

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

  • python >= 3.9.6

参数

参数

注释

ca_path

路径

在 dellemc.openmanage 5.0.0 中添加

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

custom_defaults_buffer

字符串

在 dellemc.openmanage 9.2.0 中添加

此参数提供了一个选项,可以以 XML 格式导入缓冲区输入作为自定义默认配置。

此选项适用于 _reset_to_default_ 为 CustomDefaults 时。

custom_defaults_buffercustom_defaults_file 互斥。

custom_defaults_file

字符串

在 dellemc.openmanage 9.2.0 中添加

XML 格式的自定义默认配置文件的名称。

此选项适用于 _reset_to_default_ 为 CustomDefaults 时。

custom_defaults_filecustom_defaults_buffer 互斥。

default_password

字符串

在 dellemc.openmanage 9.4.0 中添加

此参数仅在 reset_to_defaultAllResetAllWithRootDefaults 时应用。

此参数是跟踪重置操作执行后服务器的生命周期状态所必需的。如果没有提供此参数,则在重置操作后不会跟踪生命周期状态。

default_username

字符串

在 dellemc.openmanage 9.4.0 中添加

此参数仅在 reset_to_defaultAllResetAllWithRootDefaults 时应用。

此参数是跟踪重置操作执行后服务器的生命周期状态所必需的。如果没有提供此参数,则在重置操作后不会跟踪生命周期状态。

force_reset

布尔值

在 dellemc.openmanage 9.2.0 中添加

此参数提供了一个选项,可以在不检查 iDRAC 生命周期控制器状态的情况下强制重置 iDRAC。

此选项仅适用于 iDRAC9。

选项

  • 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

job_wait_timeout

整数

在 dellemc.openmanage 9.2.0 中添加

等待作业完成的时间(秒)。

这适用于 _wait_for_idrac_ 为 true 时。

默认值: 600

reset_to_default

字符串

在 dellemc.openmanage 9.2.0 中添加

如果未设置此值,则默认行为是重新启动 iDRAC。

All 丢弃所有设置并重置为默认凭据。

ResetAllWithRootDefaults 丢弃所有设置并将默认用户名重置为 root,并将密码重置为出厂值。

Default 丢弃所有设置,但保留用户和网络设置。

CustomDefaults 所有配置都设置为自定义默认值。此选项在固件版本 7.00.00.00 和更高版本中受支持。

选项

  • "Default"

  • "All"

  • "ResetAllWithRootDefaults"

  • "CustomDefaults"

timeout

整数

在 dellemc.openmanage 5.0.0 中添加

套接字级别超时(秒)。

默认值: 30

validate_certs

布尔值

在 dellemc.openmanage 5.0.0 中添加

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

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

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

选项

  • false

  • true ← (默认)

wait_for_idrac

布尔值

在 dellemc.openmanage 9.2.0 中添加

此参数提供了一个选项,用于等待 iDRAC 重置并将生命周期控制器状态设置为就绪。

选项

  • 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 的系统运行此模块。

  • 此模块支持 _idrac_ip_ 的 IPv4 和 IPv6 地址。

  • 此模块支持check_mode

  • 如果未指定reset_to_default选项,则此模块将触发优雅重启。

  • 如果iDRAC不支持重置选项,则此模块将跳过执行。

示例

---
- name: Reset the iDRAC to default and do not wait till the iDRAC is accessible.
  dellemc.openmanage.idrac_reset:
   idrac_ip: "192.168.0.1"
   idrac_user: "user_name"
   idrac_password: "user_password"
   ca_path: "/path/to/ca_cert.pem"
   reset_to_default: "Default"
   wait_for_idrac: false

- name: Reset the iDRAC to All and wait for lifecycle controller status to be ready.
  dellemc.openmanage.idrac_reset:
   idrac_ip: "192.168.0.1"
   idrac_user: "user_name"
   idrac_password: "user_password"
   ca_path: "/path/to/ca_cert.pem"
   reset_to_default: "All"
   wait_for_idrac: true
   default_username: "user_name"
   default_password: "user_password"

- name: Force reset the iDRAC to default.
  dellemc.openmanage.idrac_reset:
   idrac_ip: "192.168.0.1"
   idrac_user: "user_name"
   idrac_password: "user_password"
   ca_path: "/path/to/ca_cert.pem"
   reset_to_default: "Default"
   force_reset: true

- name: Gracefully restart the iDRAC.
  dellemc.openmanage.idrac_reset:
   idrac_ip: "192.168.0.1"
   idrac_user: "user_name"
   idrac_password: "user_password"
   ca_path: "/path/to/ca_cert.pem"

- name: Reset the iDRAC to custom defaults XML and do not wait till the iDRAC is accessible.
  dellemc.openmanage.idrac_reset:
   idrac_ip: "192.168.0.1"
   idrac_user: "user_name"
   idrac_password: "user_password"
   ca_path: "/path/to/ca_cert.pem"
   reset_to_default: "CustomDefaults"
   custom_defaults_file: "/path/to/custom_defaults.xml"

- name: Reset the iDRAC to custom defaults buffer input and do not wait till the iDRAC is accessible.
  dellemc.openmanage.idrac_reset:
   idrac_ip: "192.168.0.1"
   idrac_user: "user_name"
   idrac_password: "user_password"
   ca_path: "/path/to/ca_cert.pem"
   reset_to_default: "CustomDefaults"
   custom_defaults_buffer: "<SystemConfiguration Model=\"PowerEdge R7525\" ServiceTag=\"ABCD123\">\n<Component FQDD=\"iDRAC.Embedded.1\">\n
                               <Attribute Name=\"IPMILan.1#Enable\">Disabled</Attribute>\n </Component>\n\n</SystemConfiguration>"

返回值

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

描述

error_info

字典

HTTP错误的详细信息。

返回:HTTP错误时

示例:{"error": {"@Message.ExtendedInfo": [{"Message": "Unable to process the request because an error occurred.", "MessageArgs": [], "MessageId": "GEN1234", "RelatedProperties": [], "Resolution": "Retry the operation. If the issue persists, contact your system administrator.", "Severity": "Critical"}], "code": "Base.1.0.GeneralError", "message": "A general error has occurred. See ExtendedInfo for more information."}}

msg

字符串

iDRAC重置操作的状态。

返回:始终

示例:"Successfully performed iDRAC reset."

reset_status

字典

iDRAC重置操作的详细信息。

返回:触发重置操作时。

示例:{"idracreset": {"Data": {"StatusCode": 204}, "Message": "none", "Status": "Success", "StatusCode": 204, "retval": true}}

作者

  • Felix Stephen (@felixs88)

  • Anooja Vardhineni (@anooja-vardhineni)

  • Lovepreet Singh (@singh-lovepreet1)

  • Abhishek Sinha (@ABHISHEK-SINHA10)