dellemc.openmanage.ome_chassis_slots 模块 – 在 OpenManage Enterprise Modular 上重命名 sled 插槽

注意

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

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

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

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

dellemc.openmanage 3.6.0 中的新增功能

概要

  • 此模块允许使用设备 ID 或设备服务标签,或使用机箱服务标签和插槽号在 OpenManage Enterprise Modular 上重命名 sled 插槽。

要求

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

  • python >= 3.9.6

参数

参数

注释

ca_path

路径

在 dellemc.openmanage 5.0.0 中添加

包含用于验证的 CA 证书的 Privacy Enhanced Mail (PEM) 文件。

device_options

列表 / 元素=字典

插槽中 sled 的 ID 或服务标签以及插槽的新名称。

device_optionsslot_options 互斥。

device_id

整数

插槽中 sled 的设备 ID。

这与 device_service_tag 互斥。

device_service_tag

字符串

插槽中 sled 的服务标签。

这与 device_id 互斥。

slot_name

字符串 / 必需

为插槽提供名称。

hostname

字符串 / 必需

OpenManage Enterprise Modular IP 地址或主机名。

password

字符串

OpenManage Enterprise Modular 密码。

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

示例:export OME_PASSWORD=password

port

整数

OpenManage Enterprise Modular HTTPS 端口。

默认值: 443

slot_options

列表 / 元素=字典

机箱的服务标签、要重命名的插槽的插槽号以及插槽的新名称。

slot_optionsdevice_options 互斥。

chassis_service_tag

字符串 / 必需

机箱的服务标签。

slots

列表 / 元素=字典 / 必需

插槽号和插槽的新名称。

slot_name

字符串 / 必需

为插槽提供名称。

slot_number

整数 / 必需

要重命名的插槽的插槽号。

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

注释

注意

  • 此模块启动刷新清单任务。新名称可能需要一分钟才能反映出来。如果刷新任务超过 300 秒,则任务超时。

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

  • 此模块支持 check_mode

示例

---
- name: Rename the slots in multiple chassis using slot number and chassis service tag
  dellemc.openmanage.ome_chassis_slots:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    slot_options:
      - chassis_service_tag: ABC1234
        slots:
          - slot_number: 1
            slot_name: sled_name_1
          - slot_number: 2
            slot_name: sled_name_2
      - chassis_service_tag: ABC1235
        slots:
          - slot_number: 1
            slot_name: sled_name_1
          - slot_number: 2
            slot_name: sled_name_2

- name: Rename single slot name of the sled using sled ID
  dellemc.openmanage.ome_chassis_slots:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    device_options:
      - device_id: 10054
        slot_name: slot_device_name_1

- name: Rename single slot name of the sled using sled service tag
  dellemc.openmanage.ome_chassis_slots:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    device_options:
      - device_service_tag: ABC1234
        slot_name: service_tag_slot

- name: Rename multiple slot names of the devices
  dellemc.openmanage.ome_chassis_slots:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    device_options:
      - device_id: 10054
        slot_name: sled_name_1
      - device_service_tag: ABC1234
        slot_name: sled_name_2
      - device_id: 10055
        slot_name: sled_name_3
      - device_service_tag: PQR1234
        slot_name: sled_name_4

返回值

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

描述

error_info

字典

HTTP 错误的详细信息。

返回: 在 HTTP 错误时返回

示例: {"error": {"@Message.ExtendedInfo": [{"Message": "由于属性输入的值无效,无法完成操作。无效的 json 类型:字符串类型 ,用于 Edm.Int64 属性:Id 。", "MessageArgs": ["无效的 json 类型:字符串类型 ,用于 Edm.Int64 属性:Id"], "MessageId": "CGEN1014", "RelatedProperties": [], "Resolution": "请输入属性的有效值,然后重试操作。有关有效值的更多信息,请参阅支持站点上提供的 OpenManage Enterprise-Modular 用户指南。", "Severity": "Critical"}], "code": "Base.1.0.GeneralError", "message": "发生了一般错误。有关更多信息,请参阅 ExtendedInfo。"}}

msg

字符串

插槽重命名操作的总体状态。

返回: 始终

示例: "已成功重命名插槽。"

rename_failed_slots

列表 / 元素=字典

未重命名的有效插槽的信息。

如果重命名作业失败,则显示 JobStatus

注意 仅列出未重命名的插槽。

返回: 如果至少有一个插槽重命名失败

示例: [{"ChassisId": "12345", "ChassisName": "MX-ABCD123", "ChassisServiceTag": "ABCD123", "DeviceType": "4000", "JobId": 1234, "JobStatus": "已中止", "SlotId": "10061", "SlotName": "c2", "SlotNumber": "1", "SlotType": "4000"}, {"ChassisId": "10053", "ChassisName": "MX-PQRS123", "ChassisServiceTag": "PQRS123", "DeviceType": "1000", "JobId": 0, "JobStatus": "HTTP 错误 400:错误请求", "SlotId": "10069", "SlotName": "b2", "SlotNumber": "3", "SlotType": "2000"}]

slot_info

列表 / 元素=字典

已成功重命名的插槽的信息。

仅当使用 device_options 时,DeviceServiceTagDeviceId 选项才可用。

注意 仅列出已重命名的插槽。

返回: 如果至少有一个插槽被重命名

示例: [{"ChassisId": 10053, "ChassisServiceTag": "ABCD123", "DeviceName": "", "DeviceType": 1000, "JobId": 15746, "SlotId": "10072", "SlotName": "slot_op2", "SlotNumber": "6", "SlotType": 2000}, {"ChassisId": 10053, "ChassisName": "MX-ABCD123", "ChassisServiceTag": "ABCD123", "DeviceType": "3000", "JobId": 15747, "SlotId": "10070", "SlotName": "slot_op2", "SlotNumber": "4", "SlotType": "2000"}, {"ChassisId": "10053", "ChassisName": "MX-PQRS123", "ChassisServiceTag": "PQRS123", "DeviceId": "10054", "DeviceServiceTag": "XYZ5678", "DeviceType": "1000", "JobId": 15761, "SlotId": "10067", "SlotName": "a1", "SlotNumber": "1", "SlotType": "2000"}]

作者

  • Jagadeesh N V(@jagadeeshnv)