AAP Job

Ansible automation platform job workflow

This workflow launches an Ansible Automation Platform (AAP) job and send out a notification for success or failure upon completion. The following two (2) inputs are required:

  • Job template Id
  • Inventory group

Workflow diagram

AAP job workflow diagram

Prerequisites

  • A running instance of AAP with admin credentials.
  • A running instance of Backstage notification plugin.

Workflow application configuration

Application properties can be initialized from environment variables before running the application:

Environment variableDescriptionMandatory
AAP_URLThe AAP server URL
AAP_USERNAMEThe AAP server password
AAP_PASSWORDThe AAP server password

How to run

mvn clean quarkus:dev

Example of POST to trigger the workflow:

curl -XPOST -H "Content-Type: application/json" http://localhost:8080/aap-job -d '{"jobTemplateId": _JOB_TEMPLATE_ID_, "inventoryGroup": "_INVENTORY_GROUP_", "limit": "_LIMIT_"}'

Response:

{
    "id": "832685aa-0df0-4cf9-9e91-820b013efda6",
    "workflowdata": {
        "jobTemplateId": _JOB_TEMPLATE_ID_,
        "inventoryGroup": "_INVENTORY_GROUP_",
        "limit": "_LIMIT_",
        "launchedJob": {
            "id": 29,
            "failed": false,
            "status": "pending",
            "outputUrl": "https://your-app-platform.io/#/jobs/playbook/29/output"
        }
    }
}

Last modified March 29, 2024: Add aap job workflow example (d77d01b)