Skip to main content
Job templates define how Ansible playbooks are executed in AWX. They bring together projects, inventories, credentials, and playbooks to create reusable automation workflows.

Understanding Job Templates

A Job Template is a definition for running an Ansible playbook. It includes:
  • Project: Source of playbooks
  • Playbook: The specific playbook to run
  • Inventory: Target hosts and groups
  • Credentials: Authentication for hosts and other services
  • Execution Environment: Container image with Ansible and dependencies
  • Variables: Extra variables to pass to the playbook
  • Options: Verbosity, limits, tags, and other runtime settings

Job Types

Run

Execute the playbook normally (default)

Check

Dry-run mode - shows what would change without making changes

Creating a Job Template

1

Via Web UI

  1. Navigate to Templates in the sidebar
  2. Click Add → Add job template
  3. Fill in the required fields:
    • Name: Descriptive name
    • Job Type: Run or Check
    • Inventory: Select target inventory
    • Project: Select project with playbooks
    • Playbook: Choose from available playbooks
    • Credentials: Add required credentials
  4. Configure options:
    • Verbosity: Output detail level (0-4)
    • Forks: Parallel execution count
    • Limit: Restrict to specific hosts
    • Instance Groups: Where to run the job
  5. Click Save
2

Via API

3

Via Ansible

Launching Jobs

Simple Launch

  1. Navigate to Templates
  2. Click the rocket icon next to your template
  3. Fill in any prompted values
  4. Click Launch

Launch with Extra Variables

Launch with Limit

Restrict execution to specific hosts:

Launch with Different Inventory

Job Template Options

Credentials

Multiple credentials can be attached:
Credential types:
  • Machine (SSH): For host authentication
  • Vault: Ansible Vault passwords
  • Cloud: AWS, Azure, GCP credentials
  • Network: Network device credentials
  • Source Control: Git/SCM credentials
  • Custom: User-defined credential types

Privilege Escalation

Enable privilege escalation (sudo):
In the API:

Verbosity Levels

Forks (Parallelism)

Control parallel execution:

Job Tags

Run specific tagged tasks:
In Ansible playbook:

Diff Mode

Show file changes:
Useful for:
  • Reviewing template changes
  • Auditing configuration modifications
  • Compliance reporting

Prompt on Launch

Allow users to override values when launching:
Available prompts:
  • ask_inventory_on_launch
  • ask_credential_on_launch
  • ask_variables_on_launch
  • ask_limit_on_launch
  • ask_tags_on_launch
  • ask_skip_tags_on_launch
  • ask_job_type_on_launch
  • ask_verbosity_on_launch
  • ask_diff_mode_on_launch
  • ask_scm_branch_on_launch
  • ask_execution_environment_on_launch
  • ask_forks_on_launch
  • ask_timeout_on_launch
  • ask_instance_groups_on_launch

Job Slicing

Distribute a job across multiple slices for large inventories:
When launched, this creates a workflow job with 10 slices:
  • Each slice processes 1/10th of the inventory
  • Slices run in parallel
  • Overall job completes faster

Execution Environments

Specify the container image to use:

Instance Groups

Control where jobs execute:
Jobs will prefer the first available instance group in the list.

Job Lifecycle

Job States

1

Pending

Job is queued and waiting to start
2

Waiting

Job is waiting for dependencies or approval
3

Running

Job is currently executing
4

Successful

Job completed without errors
5

Failed

Job failed with errors
6

Error

Job encountered a system error
7

Canceled

Job was canceled by user

Monitoring Job Progress

Waiting for Job Completion

Canceling Jobs

Click the Cancel button on the job details page

Relaunching Jobs

Relaunch a job with the same parameters:
Relaunch uses:
  • Same inventory, project, playbook
  • Same credentials
  • Same extra variables
  • Same limit, tags, etc.

Simultaneous Jobs

By default, job templates don’t allow concurrent execution. Enable it:
Be careful with simultaneous jobs - they may conflict if they modify the same resources.

Webhooks

Trigger jobs via webhooks (GitHub, GitLab, etc.):
Webhook URL format:
Configure in GitHub:
  1. Repository Settings → Webhooks → Add webhook
  2. Payload URL: Your AWX webhook URL
  3. Content type: application/json
  4. Secret: Your webhook credential
  5. Events: Push, Pull Request, etc.

Job Templates vs. Workflows

Job Templates

Run a single playbookUse when:
  • Single task to execute
  • Simple automation
  • No dependencies

Workflows

Chain multiple job templatesUse when:
  • Multi-stage deployments
  • Conditional logic
  • Complex orchestration

Best Practices

Use Surveys

Create surveys for user-friendly variable input

Set Timeouts

Configure reasonable timeouts to prevent hung jobs

Limit Scope

Use limits and tags to minimize blast radius

Test in Check Mode

Always test with job_type: check first

Troubleshooting

Common causes:
  • Missing or invalid credentials
  • Inventory is empty
  • Project sync failed
  • Playbook not found
Check job output:
Possible issues:
  • No available instance groups
  • Capacity limits reached
  • Previous job blocking (simultaneous = false)
Check instance capacity:
Verify:
  • Project update completed successfully
  • Playbook file has .yml or .yaml extension
  • Playbook is valid Ansible syntax
  • File is in the project repository
List available playbooks:
Check variable precedence:
  1. Job extra_vars (highest)
  2. Job template extra_vars
  3. Survey responses
  4. Host/group variables
  5. Inventory variables (lowest)
View final variables:

Surveys

Add surveys to job templates for user input

Scheduling

Schedule jobs to run automatically

Notifications

Set up notifications for job status

Workflows

Create complex workflows with multiple jobs