dellemc.openmanage.idrac_bios 模块 – 修改和清除 BIOS 属性、重置 BIOS 设置和配置引导源

注意

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

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

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

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

dellemc.openmanage 2.1.0 中的新增功能

概要

  • 此模块允许修改 BIOS 属性。还可以清除挂起的 BIOS 属性并将 BIOS 重置为默认设置。

  • 可以启用或禁用引导源。可以配置引导顺序。

要求

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

  • omsdk >= 1.2.490

  • python >= 3.9.6

参数

参数

注释

apply_time

字符串

attributes 的应用时间。

这仅适用于 attributes

Immediate 允许用户立即重启主机并应用更改。job_wait 适用。

OnReset 允许用户在下次主机服务器重启时应用更改。

AtMaintenanceWindowStart 允许用户在 maintenance_window 中指定的维护窗口开始时应用。将计划重启作业。

InMaintenanceWindowOnReset 允许在手动重置后但在 maintenance_window 中指定的维护窗口内应用。

选择

  • "Immediate" ←(默认)

  • "OnReset"

  • "AtMaintenanceWindowStart"

  • "InMaintenanceWindowOnReset"

attributes

字典

BIOS 属性和值对的字典。属性应属于 Redfish Dell BIOS 属性注册表。使用 https://I(idrac_ip/redfish/v1/Systems/System.Embedded.1/Bios) 查看 Redfish URI。

这与 boot_sourcesclear_pendingreset_bios 互斥。

boot_sources

列表 / elements=any

(已弃用)用于设置引导源设置的引导设备列表。

boot_sourcesattributesclear_pendingreset_bios 互斥。

job_wait 不适用。该模块会等待直到此任务完成。

此功能已弃用,请使用 dellemc.openmanage.idrac_boot 配置引导源。

ca_path

路径

dellemc.openmanage 5.0.0 中新增

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

clear_pending

布尔值

允许用户清除所有挂起的 BIOS 属性更改。

true 将放弃对 BIOS 属性的任何挂起更改,或者如果处于计划状态,则删除作业。

此操作不会创建任何作业。

false 将不执行任何操作。

这与 boot_sourcesattributesreset_bios 互斥。

注意 由于引导源配置而计划的任何 BIOS 作业都不会被清除。

选择

  • 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

布尔值

提供等待作业完成的选项。

apply_timeImmediate 时,这适用于 attributes

选择

  • false

  • true ← (默认)

job_wait_timeout

整数

job_wait 的最大等待时间(以秒为单位)。仅在此持续时间内跟踪作业。

job_waittrue 时,此选项适用。

默认值: 1200

maintenance_window

字典

用于安排维护窗口的选项。

apply_timeAtMaintenanceWindowStartInMaintenanceWindowOnReset 时,此选项是必需的。

duration

integer / 必填

维护窗口的持续时间(以秒为单位)。

start_time

字符串 / 必需

要安排的维护窗口的开始时间。

格式为 YYYY-MM-DDThh:mm:ss<offset>

<offset> 是当前 iDRAC 中设置的时区与 UTC 的时间偏移量,格式为:IST 为 +05:30。

reset_bios

布尔值

将 BIOS 重置为默认设置并触发主机系统重启。

这将在重启后应用于主机。

此操作不会创建任何作业。

false 将不执行任何操作。

此选项与 boot_sourcesattributesclear_pending 互斥。

true 时,此操作将始终报告为发现更改需要应用。

选择

  • false

  • true

reset_type

字符串

force_restart 强制重启主机系统。

graceful_restart 正常重启主机系统。

apply_timeImmediate 时,此选项适用于 reset_biosattributes

选择

  • "graceful_restart" ← (默认)

  • "force_restart"

share_mnt

字符串

(已弃用) 具有 ansible 用户读写权限的网络共享的本地挂载路径。此选项对于网络共享是强制性的。

share_name

字符串

(已弃用) 网络共享或本地路径。

share_password

别名:share_pwd

字符串

(已弃用) 网络共享用户密码。此选项对于 CIFS 共享是强制性的。

share_user

字符串

(已弃用) 网络共享用户名。如果用户是域的一部分,请使用 ‘user@domain’ 或 domain//user 格式。此选项对于 CIFS 共享是强制性的。

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 ← (默认)

备注

注意

  • 仅当执行 boot_sources 操作时才需要安装 omsdk。

  • 此模块需要 idrac_user 的“管理员”权限。

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

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

  • 此模块支持 check_mode

示例

---
- name: Configure generic attributes of the BIOS
  dellemc.openmanage.idrac_bios:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    attributes:
      BootMode: "Bios"
      OneTimeBootMode: "Enabled"
      BootSeqRetry: "Enabled"

- name: Configure PXE generic attributes
  dellemc.openmanage.idrac_bios:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    attributes:
      PxeDev1EnDis: "Enabled"
      PxeDev1Protocol: "IPV4"
      PxeDev1VlanEnDis: "Enabled"
      PxeDev1VlanId: 1
      PxeDev1Interface: "NIC.Embedded.1-1-1"
      PxeDev1VlanPriority: 2

- name: Configure BIOS attributes at Maintenance window
  dellemc.openmanage.idrac_bios:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    apply_time: AtMaintenanceWindowStart
    maintenance_window:
      start_time: "2022-09-30T05:15:40-05:00"
      duration: 600
    attributes:
      BootMode: "Bios"
      OneTimeBootMode: "Enabled"
      BootSeqRetry: "Enabled"

- name: Clear pending BIOS attributes
  dellemc.openmanage.idrac_bios:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    clear_pending: true

- name: Reset BIOS attributes to default settings.
  dellemc.openmanage.idrac_bios:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    validate_certs: false
    reset_bios: true

- name: Configure boot sources
  dellemc.openmanage.idrac_bios:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    boot_sources:
      - Name: "NIC.Integrated.1-2-3"
        Enabled: true
        Index: 0

- name: Configure multiple boot sources
  dellemc.openmanage.idrac_bios:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    boot_sources:
      - Name: "NIC.Integrated.1-1-1"
        Enabled: true
        Index: 0
      - Name: "NIC.Integrated.2-2-2"
        Enabled: true
        Index: 1
      - Name: "NIC.Integrated.3-3-3"
        Enabled: true
        Index: 2

- name: Configure boot sources - Enabling
  dellemc.openmanage.idrac_bios:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    boot_sources:
      - Name: "NIC.Integrated.1-1-1"
        Enabled: true

- name: Configure boot sources - Index
  dellemc.openmanage.idrac_bios:
    idrac_ip: "192.168.0.1"
    idrac_user: "user_name"
    idrac_password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    boot_sources:
      - Name: "NIC.Integrated.1-1-1"
        Index: 0

返回值

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

描述

error_info

字典

HTTP 错误的详细信息。

返回:在 HTTP 错误时

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

invalid_attributes

字典

提供的无效属性的字典。

返回:在无效属性或值时。

示例: {"AcPwrRcvryUserDelay": "整数超出有效范围。", "AssetTag": "属性不存在。", "BootSeqRetry": "枚举的无效值。", "Proc1Brand": "只读属性,无法修改。", "PxeDev1VlanId": "不是有效的整数。"}

msg

字典

boot_sources 的作业状态或对 bios 执行的操作的状态。

返回:成功

示例: {"CompletionTime": "2020-04-20T18:50:20", "Description": "作业实例", "EndTime": null, "Id": "JID_873888162305", "JobState": "已完成", "JobType": "ImportConfiguration", "Message": "成功导入并应用服务器配置配置文件。", "MessageArgs": [], "MessageId": "SYS053", "Name": "导入配置", "PercentComplete": 100, "StartTime": "TIME_NOW", "Status": "成功", "TargetSettingsURI": null, "retval": true}

status_msg

字符串

BIOS 操作的总体状态。

返回:成功

示例: "已成功清除待处理的 BIOS 属性。"

作者

  • Felix Stephen (@felixs88)

  • Anooja Vardhineni (@anooja-vardhineni)

  • Jagadeesh N V (@jagadeeshnv)

  • Shivam Sharma (@shivam-sharma)