capabilities.work

Ansible Automation Platform Launch, Monitor, and Cancel Job

A 4-step recipe with Red Hat. We can help you get access.

Recipe · 4 steps

Ansible Automation Platform Launch, Monitor, and Cancel Job

with Red Hat · IT Operations Management

Launch a known job template, monitor the job, and cancel it on demand.

  1. Retrieve the job template to confirm it exists before attempting to launch a job from it.
  2. Launch a job from the confirmed template, optionally narrowing execution with a host limit pattern.
  3. Retrieve the job record and re-poll while it remains in a non-terminal state; end the workflow once it reaches a terminal status.
  4. Cancel the running job. The API accepts the cancellation request for jobs that are currently pending or running.
What you'll need to have ready
  • token: OAuth2 bearer token for the Automation Platform API.
  • templateId: The id of the job template to launch.
  • limit: Optional host pattern to limit the inventory for this run.
  • abort: When true, the running job is cancelled instead of being awaited.
For your developer

Arazzo workflow red-hat:launch-monitor-cancel-job, 4 operations: getJobTemplate → launchJobTemplate → getJob → cancelJob. Specs on APIs.io.