dellemc.openmanage.ome_device_power_settings 模块 – 在 OpenManage Enterprise Modular 上配置机箱电源设置

注意

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

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

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

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

dellemc.openmanage 4.2.0 中的新增功能

概要

  • 此模块允许配置 OpenManage Enterprise Modular 上的机箱电源设置。

需求

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

  • python >= 3.9.6

参数

参数

注释

ca_path

路径

在 dellemc.openmanage 5.0.0 中添加

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

device_id

整数

需要更新其设置的机箱的 ID。

如果未指定设备 ID,则此模块将更新 *主机名* 的电源设置。

*device_id* 与 *device_service_tag* 互斥。

device_service_tag

字符串

需要更新其设置的机箱的服务标签。

如果未指定设备服务标签,则此模块将更新 *主机名* 的电源设置。

*device_service_tag* 与 *device_id* 互斥。

hostname

字符串 / 必需

OpenManage Enterprise Modular 的 IP 地址或主机名。

hot_spare_configuration

字典

热备配置的设置。

enable_hot_spare

布尔值 / 必需

启用或禁用热备配置,以便在电源单元 (PSU) 使用的电源较低时促进电压调节。

选项

  • false

  • true

primary_grid

字符串

PSU 电网的选项。

GRID_1 电网 1 上的热备。

GRID_2 电网 2 上的热备。

选项

  • "GRID_1" ← (默认)

  • "GRID_2"

password

字符串

OpenManage Enterprise Modular 密码。

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

示例:export OME_PASSWORD=password

port

整数

OpenManage Enterprise Modular HTTPS 端口。

默认值: 443

power_configuration

字典

电源配置的设置。

enable_power_cap

布尔值 / 必需

启用或禁用电源上限设置。

选项

  • false

  • true

power_cap

整数

设备的最大功耗限制。以瓦特为单位指定功耗限制。

如果将 *enable_power_cap* 设置为 true,则需要此参数。

redundancy_configuration

字典

冗余配置的设置。

redundancy_policy

字符串

配置冗余策略的选项。

NO_REDUNDANCY 不使用冗余策略。

GRID_REDUNDANCY 将电源分配到两个电网中。

PSU_REDUNDANCY 将电源分配到所有 PSU 之间。

选项

  • "NO_REDUNDANCY" ← (默认)

  • "GRID_REDUNDANCY"

  • "PSU_REDUNDANCY"

timeout

整数

在 dellemc.openmanage 5.0.0 中添加

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

默认值: 30

username

字符串

OpenManage Enterprise Modular 用户名。

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

示例:export OME_USERNAME=username

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,则使用环境变量OME_X_AUTH_TOKEN

示例:export OME_X_AUTH_TOKEN=x_auth_token

备注

注意

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

  • 此模块支持check_mode

示例

---
- name: Update power configuration settings of a chassis using the device ID.
  dellemc.openmanage.ome_device_power_settings:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    device_id: 25011
    power_configuration:
      enable_power_cap: true
      power_cap: 3424

- name: Update redundancy configuration settings of a chassis using the device service tag.
  dellemc.openmanage.ome_device_power_settings:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    device_service_tag: GHRT2RL
    redundancy_configuration:
      redundancy_policy: GRID_REDUNDANCY

- name: Update hot spare configuration settings of a chassis using device ID.
  dellemc.openmanage.ome_device_power_settings:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    device_id: 25012
    hot_spare_configuration:
      enable_hot_spare: true
      primary_grid: GRID_1

返回值

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

描述

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

字符串

设备电源设置的总体状态。

返回:始终

示例:"Successfully updated the power settings."

power_details

字典

成功更新电源设置时返回。

返回:成功

示例:{"EnableHotSpare": true, "EnablePowerCapSettings": true, "MaxPowerCap": "3424", "MinPowerCap": "3291", "PowerCap": "3425", "PrimaryGrid": "GRID_1", "RedundancyPolicy": "NO_REDUNDANCY", "SettingType": "Power"}

作者

  • Felix Stephen (@felixs88)