dellemc.openmanage.ome_profile_info 模块 – 获取带有属性详细信息的配置文件

注意

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

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

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

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

dellemc.openmanage 7.2.0 中的新增功能

概要

  • 此模块可在 OpenManage Enterprise 或 OpenManage Enterprise Modular 上获取带有属性的配置文件。

要求

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

  • python >= 3.9.6

参数

参数

注释

ca_path

路径

在 dellemc.openmanage 5.0.0 中添加

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

hostname

字符串 / 必需

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

password

字符串

OpenManage Enterprise 或 OpenManage Enterprise Modular 密码。

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

示例:export OME_PASSWORD=password

port

整数

OpenManage Enterprise 或 OpenManage Enterprise Modular 的 HTTPS 端口。

默认值: 443

profile_id

整数

配置文件的 ID。

这与 *profile_name*、*system_query_options*、*template_id* 和 *template_name* 互斥。

profile_name

字符串

配置文件的名称。

这与 *template_id*、*profile_id*、*system_query_options* 和 *template_name* 互斥。

system_query_options

字典

提供受支持的 odata 过滤器的选项。

可以根据 ProfileName、TemplateName、TargetTypeId、TargetName、ChassisName、ProfileState、LastRunStatus 或 ProfileModified 获取和排序配置文件列表。

这与 *profile_name*、*profile_id*、*template_id* 和 *template_name* 互斥。

注意 如果未提供 *profile_name*、*profile_id*、*template_id* 或 *template_name* 选项,则模块将检索所有配置文件。

template_id

整数

提供模板的 ID 以检索与其链接的配置文件列表。

这与 *profile_name*、*profile_id*、*system_query_options* 和 *template_name* 互斥。

template_name

字符串

提供模板的名称以检索与其链接的配置文件列表。

这与 *profile_name*、*profile_id*、*template_id* 和 *system_query_options* 互斥。

timeout

整数

在 dellemc.openmanage 5.0.0 中添加

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

默认值: 30

username

字符串

OpenManage Enterprise 或 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 的系统上运行此模块。

  • 此模块支持 check_mode

示例

---
- name: Retrieve all profiles
  dellemc.openmanage.ome_profile_info:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"

- name: Retrieve profile using the name
  dellemc.openmanage.ome_profile_info:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    profile_name: eprof 00001

- name: Retrieve profile using the id
  dellemc.openmanage.ome_profile_info:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    profile_id: 10129

- name: Retrieve the profiles using the template name
  dellemc.openmanage.ome_profile_info:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    template_name: t2

- name: Retrieve the profiles using the template id
  dellemc.openmanage.ome_profile_info:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    template_id: 11

- name: Retrieve the profiles based on the odata filters
  dellemc.openmanage.ome_profile_info:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    system_query_options:
      filter: TemplateName eq 'mytemplate'
      orderby: ProfileState

返回值

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

描述

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

字符串

配置文件信息检索的状态。

返回: 始终

示例: "已成功 检索 配置文件 信息。"

profile_info

列表 / 元素=字典

配置文件信息。

返回:成功

示例: [{"AttributeDetails": {"System": {"Server Operating System": {"ServerOS 1 Server Host Name": 4965}, "Server Topology": {"ServerTopology 1 Aisle Name": 4958, "ServerTopology 1 Data Center Name": 4957, "ServerTopology 1 Rack Name": 4959, "ServerTopology 1 Rack Slot": 4960, "ServerTopology 1 Room Name": 4963}}, "iDRAC": {"Active Directory": {"ActiveDirectory 1 Active Directory RAC Name": 4066}, "NIC Information": {"NIC 1 Enable VLAN": 4229, "NIC 1 VLAN ID": 4231}}}, "AttributeIdMap": {"4066": {"IsIgnored": true, "IsReadOnly": false, "Value": null}, "4229": {"IsIgnored": false, "IsReadOnly": false, "Value": "Disabled"}, "4231": {"IsIgnored": false, "IsReadOnly": false, "Value": "1"}, "4957": {"IsIgnored": true, "IsReadOnly": false, "Value": "Dell LAB"}, "4958": {"IsIgnored": true, "IsReadOnly": false, "Value": null}, "4959": {"IsIgnored": true, "IsReadOnly": false, "Value": "OMAMDEV"}, "4960": {"IsIgnored": true, "IsReadOnly": false, "Value": "10A"}, "4963": {"IsIgnored": true, "IsReadOnly": false, "Value": "second floor"}, "4965": {"IsIgnored": true, "IsReadOnly": false, "Value": "hostname"}}, "ChassisId": 0, "ChassisName": null, "CreatedBy": "admin", "CreatedDate": "2019-09-26 13:56:41.924966", "DataSchemaId": 8, "DeploymentTaskId": 0, "DeviceIdInSlot": 0, "EditedBy": null, "GroupId": 0, "GroupName": null, "Id": 71460, "LastDeployDate": "", "LastEditDate": "2020-12-11 08:27:20.500564", "LastRunStatus": 2200, "NetworkBootToIso": null, "ProfileDescription": "from source template: (Template)", "ProfileModified": 0, "ProfileName": "Profile 00001", "ProfileState": 0, "TargetId": 0, "TargetName": null, "TargetTypeId": 0, "TemplateId": 8, "TemplateName": "Template"}]

作者

  • Jagadeesh N V(@jagadeeshnv)