dellemc.openmanage.ome_job_info module – Get job details for a given job ID or an entire job queue on OpenMange Enterprise

Note

This module is part of the dellemc.openmanage collection (version 9.9.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install dellemc.openmanage. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: dellemc.openmanage.ome_job_info.

New in dellemc.openmanage 2.0.0

Synopsis

  • This module retrieves job details for a given job ID or an entire job queue on OpenMange Enterprise.

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 3.9.6

Parameters

Parameter

Comments

ca_path

path

added in dellemc.openmanage 5.0.0

The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation.

fetch_execution_history

boolean

Fetches the execution history of the job.

fetch_execution_history is only applicable when valid job_id is given.

When true, fetches all the execution history details.

When false, fetches only the job info and last execution details.

Choices:

  • false ← (default)

  • true

hostname

string / required

OpenManage Enterprise or OpenManage Enterprise Modular IP address or hostname.

job_id

integer

Unique ID of the job.

password

string

OpenManage Enterprise or OpenManage Enterprise Modular password.

If the password is not provided, then the environment variable OME_PASSWORD is used.

Example: export OME_PASSWORD=password

port

integer

OpenManage Enterprise or OpenManage Enterprise Modular HTTPS port.

Default: 443

system_query_options

dictionary

Options for pagination of the output.

filter

string

Filter records by the values supported.

skip

integer

Number of records to skip. Default value is 0.

top

integer

Number of records to return. Default value is 100.

timeout

integer

added in dellemc.openmanage 5.0.0

The socket level timeout in seconds.

Default: 30

username

string

OpenManage Enterprise or OpenManage Enterprise Modular username.

If the username is not provided, then the environment variable OME_USERNAME is used.

Example: export OME_USERNAME=username

validate_certs

boolean

added in dellemc.openmanage 5.0.0

If false, the SSL certificates will not be validated.

Configure false only on personally controlled sites where self-signed certificates are used.

Prior to collection version 5.0.0, the validate_certs is false by default.

Choices:

  • false

  • true ← (default)

x_auth_token

string

added in dellemc.openmanage 9.3.0

Authentication token.

If the x_auth_token is not provided, then the environment variable OME_X_AUTH_TOKEN is used.

Example: export OME_X_AUTH_TOKEN=x_auth_token

Notes

Note

  • Run this module from a system that has direct access to Dell OpenManage Enterprise.

  • This module supports check_mode.

Examples

---
- 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

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

job_info

dictionary

Details of the OpenManage Enterprise jobs.

Returned: success

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

string

Overall status of the job facts operation.

Returned: always

Sample: "Successfully fetched the job info"

Authors

  • Jagadeesh N V (@jagadeeshnv)

  • Abhishek Sinha (@Abhishek-Dell)