dellemc.openmanage.ome_job_info 模块 – 获取 OpenManage Enterprise 上给定作业 ID 或整个作业队列的作业详细信息

注意

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

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

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

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

dellemc.openmanage 2.0.0 中的新增功能

概要

  • 此模块检索 OpenManage Enterprise 上给定作业 ID 或整个作业队列的作业详细信息。

要求

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

  • python >= 3.9.6

参数

参数

注释

ca_path

路径

在 dellemc.openmanage 5.0.0 中添加

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

fetch_execution_history

布尔值

获取作业的执行历史记录。

fetch_execution_history 仅在提供有效的 job_id 时适用。

当为 true 时,获取所有执行历史记录详细信息。

当为 false 时,仅获取作业信息和上次执行的详细信息。

选项

  • false ← (默认)

  • true

hostname

字符串 / 必需

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

job_id

整数

作业的唯一 ID。

password

字符串

OpenManage Enterprise 或 OpenManage Enterprise Modular 密码。

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

示例:export OME_PASSWORD=password

port

整数

OpenManage Enterprise 或 OpenManage Enterprise Modular 的 HTTPS 端口。

默认值: 443

system_query_options

字典

输出分页的选项。

filter

字符串

按支持的值过滤记录。

skip

整数

要跳过的记录数。默认值为 0。

top

整数

要返回的记录数。默认值为 100。

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: Get all jobs details
  dellemc.openmanage.ome_job_info:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"

- name: Get job details for id
  dellemc.openmanage.ome_job_info:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    job_id: 12345

- name: Get filtered job details
  dellemc.openmanage.ome_job_info:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    system_query_options:
      top: 2
      skip: 1
      filter: "JobType/Id eq 8"

- name: Get detail job execution history with last execution detail for a job.
  dellemc.openmanage.ome_job_info:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    job_id: 12345
    fetch_execution_history: true

返回值

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

描述

job_info

字典

OpenManage Enterprise 作业的详细信息。

返回:成功

Sample: {"value": [{"Builtin": false, "CreatedBy": "admin", "Editable": true, "EndTime": null, "ExecutionHistories": [{"EndTime": "2023-06-07 09:33:08.403", "ExecutedBy": "admin", "ExecutionHistoryDetails": [{"ElapsedTime": "00:00:00", "EndTime": "2023-06-07 09:33:08.189", "ExecutionHistoryId": 1243224, "Id": 1288519, "IdBaseEntity": 0, "JobStatus": {"Id": 2070, "Name": "Failed"}, "Key": "198.168.0.1", "Progress": "100", "StartTime": "2023-06-07 09:33:07.525", "Value": "Running\nDiscovery of target 198.168.0.1 started .\nDiscovery target resolved to IP  198.168.0.1 .\n: ========== EEMI Code: CGEN1009 ==========\nMessage: Unable to perform the requested action because the device management endpoint authentication over WSMAN, REDFISH failed. \nRecommended actions: Make sure the credentials associated with the device management endpoint are valid and retry the operation.\n=======================================\nTask Failed. Completed With Errors."}, {"ElapsedTime": "00:00:00", "EndTime": "2023-06-07 09:33:08.313", "ExecutionHistoryId": 1243224, "Id": 1288518, "IdBaseEntity": 0, "JobStatus": {"Id": 2070, "Name": "Failed"}, "Key": "198.168.0.2", "Progress": "100", "StartTime": "2023-06-07 09:33:07.521", "Value": "Running\nDiscovery of target 198.168.0.2 started. \nDiscovery target resolved to IP  198.168.0.2 .\n: ========== EEMI Code: CGEN1009 ==========\nMessage: Unable to perform the requested action because the device management endpoint authentication over WSMAN, REDFISH failed. \nRecommended actions: Make sure the credentials associated with the device management endpoint are valid and retry the operation.\n=======================================\nTask Failed. Completed With Errors."}], "Id": 1243224, "JobId": 10429, "JobName": "Discovery-201", "JobStatus": {"Id": 2070, "Name": "Failed"}, "LastUpdateTime": "2023-06-07 09:33:08.447185", "Progress": "100", "StartTime": "2023-06-07 09:33:07.148"}, {"EndTime": "2023-06-07 09:30:56.338", "ExecutedBy": "admin", "ExecutionHistoryDetails": [{"ElapsedTime": "00:00:00", "EndTime": "2023-06-07 09:30:56.085", "ExecutionHistoryId": 1243218, "Id": 1288512, "IdBaseEntity": 0, "JobStatus": {"Id": 2070, "Name": "Failed"}, "Key": "198.168.0.1", "Progress": "100", "StartTime": "2023-06-07 09:30:55.441", "Value": "Running\nDiscovery of target 198.168.0.1 started. \nDiscovery target resolved to IP  198.168.0.1 .\n: ========== EEMI Code: CGEN1009 ==========\nMessage: Unable to perform the requested action because the device management endpoint authentication over WSMAN, REDFISH failed. \nRecommended actions: Make sure the credentials associated with the device management endpoint are valid and retry the operation.\n=======================================\nTask Failed. Completed With Errors."}, {"ElapsedTime": "00:00:00", "EndTime": "2023-06-07 09:30:56.21", "ExecutionHistoryId": 1243218, "Id": 1288511, "IdBaseEntity": 0, "JobStatus": {"Id": 2070, "Name": "Failed"}, "Key": "198.168.0.2", "Progress": "100", "StartTime": "2023-06-07 09:30:55.439", "Value": "Running\nDiscovery of target 198.168.0.2 started. \nDiscovery target resolved to IP  198.168.0.2 .\n: ========== EEMI Code: CGEN1009 ==========\nMessage: Unable to perform the requested action because the device management endpoint authentication over WSMAN, REDFISH failed. \nRecommended actions: Make sure the credentials associated with the device management endpoint are valid and retry the operation.\n=======================================\nTask Failed. Completed With Errors."}], "Id": 1243218, "JobId": 10429, "JobName": "Discovery-201", "JobStatus": {"Id": 2070, "Name": "Failed"}, "LastUpdateTime": "2023-06-07 09:30:56.365294", "Progress": "100", "StartTime": "2023-06-07 09:30:55.064"}], "Id": 10429, "JobDescription": "Discovery-201", "JobName": "Discovery-201", "JobStatus": {"Id": 2080, "Name": "New"}, "JobType": {"Id": 101, "Internal": false, "Name": "Discovery_Task"}, "LastExecutionDetail": {"ElapsedTime": null, "EndTime": "2023-06-07 09:33:08.189", "ExecutionHistoryId": 1243224, "Id": 1288519, "IdBaseEntity": 0, "JobStatus": {"Id": 2070, "Name": "Failed"}, "Key": "198.168.0.1", "Progress": "100", "StartTime": "2023-06-07 09:33:07.525", "Value": "Running\nDiscovery of target 198.168.0.1 started. \nDiscovery target resolved to IP  198.168.0.1 .\n: ========== EEMI Code: CGEN1009 ==========\nMessage: Unable to perform the requested action because the device management endpoint authentication over WSMAN, REDFISH failed. \nRecommended actions: Make sure the credentials associated with the device management endpoint are valid and retry the operation. \n=======================================\nTask Failed. Completed With Errors."}, "LastRun": "2023-06-07 09:33:07.161", "LastRunStatus": {"Id": 2070, "Name": "Failed"}, "NextRun": null, "Params": [], "Schedule": "startnow", "StartTime": null, "State": "Enabled", "Targets": [], "UpdatedBy": "admin", "UserGenerated": true, "Visible": true}]}

msg

字符串

作业事实操作的总体状态。

返回:始终

示例: "Successfully fetched the job info"

作者

  • Jagadeesh N V (@jagadeeshnv)

  • Abhishek Sinha (@Abhishek-Dell)