Interview Prep/Ansible/AWX, AAP and Cloud Integration

How do you trigger AWX jobs from CI or other systems?

IntermediateProductionAWX, AAP and Cloud Integration
Answer

Three options, in order of preference for pipelines:

# 1. awx CLI (pip install awxkit): launch and wait for the result
export CONTROLLER_HOST=https://awx.example.com CONTROLLER_OAUTH_TOKEN=...
awx job_templates launch "Deploy web - prod" \
  --extra_vars '{"app_version": "2.4.1"}' --limit web --monitor

# 2. REST API
curl -s -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"extra_vars": {"app_version": "2.4.1"}}' \
  https://awx.example.com/api/v2/job_templates/42/launch/
  1. Webhooks: enable the GitHub or GitLab webhook on a job template, so a push or merge triggers it directly.

Use a dedicated service account with execute-only rights on that template. --monitor makes the CI job fail when the AWX job fails, which keeps the pipeline honest.

All Ansible questions Roadmap: Ansible

More on AWX, AAP and Cloud Integration