Overview
Job templates define parameters for running Ansible playbooks. They combine a project, playbook, inventory, and credentials into a reusable template that can be launched on-demand or scheduled.Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v2/job_templates/ | List job templates |
| POST | /api/v2/job_templates/ | Create job template |
| GET | /api/v2/job_templates/{id}/ | Retrieve job template |
| PATCH | /api/v2/job_templates/{id}/ | Update job template |
| DELETE | /api/v2/job_templates/{id}/ | Delete job template |
| POST | /api/v2/job_templates/{id}/launch/ | Launch job |
| POST | /api/v2/job_templates/{id}/copy/ | Copy job template |
List Job Templates
Create Job Template
Job template name
Job template description
Job type:
run or checkInventory ID
Project ID
Playbook filename from the project
Array of credential IDs
Number of parallel processes (0 = use Ansible default)
Host pattern to limit job execution
Ansible verbosity: 0-5 (0=normal, 5=connection debug)
Extra variables in YAML or JSON
Comma-separated Ansible tags to run
Comma-separated Ansible tags to skip
Task name to start at
Job timeout in seconds (0 = no timeout)
Show differences when files are changed
Allow multiple jobs from this template to run simultaneously
Use Ansible fact cache
Enable privilege escalation
Enable provisioning callback with this key
Prompt for field at launch:
ask_inventory_on_launchask_credential_on_launchask_limit_on_launchask_tags_on_launchask_skip_tags_on_launchask_job_type_on_launchask_verbosity_on_launchask_variables_on_launchask_scm_branch_on_launchask_diff_mode_on_launchask_execution_environment_on_launchask_labels_on_launchask_forks_on_launchask_job_slice_count_on_launchask_timeout_on_launchask_instance_groups_on_launch
Enable survey
Enable webhook:
github or gitlabWebhook credential ID
Execution environment ID
Array of label IDs
Array of instance group IDs
Number of job slices for distributed execution
Retrieve Job Template
Template status:
new, pending, waiting, running, successful, failed, error, canceled, never updated, ok, missingLast job execution timestamp
Whether last job failed
Next scheduled run
Links to related resources:
organization- Parent organizationinventory- Job inventoryproject- Source projectexecution_environment- Execution environmentcredentials- Attached credentialslabels- Associated labelsjobs- Job historyschedules- Execution scheduleslaunch- Launch endpointwebhook_key- Webhook configurationwebhook_receiver- Webhook URLactivity_stream- Activity lognotification_templates_*- Notification templatessurvey_spec- Survey specificationaccess_list- Access listobject_roles- Available rolesinstance_groups- Instance groupsslice_workflow_jobs- Slice workflow jobscopy- Copy endpoint
Update Job Template
Delete Job Template
Launch Job
ask_*_on_launch is enabled.
Returns a job object with status URL.
Survey Specification
Get Survey
Create/Update Survey
Delete Survey
Jobs
List jobs created from this template:Schedules
Labels
Instance Groups
Credentials
Notifications
Webhooks
Get Webhook Key
Regenerate Webhook Key
Provisioning Callback
Enable callback to allow hosts to trigger their own configuration:- Set
host_config_keyon the job template - Configure the callback URL on the host
Object Roles
- admin_role - Full template administration
- execute_role - Launch jobs from template
- read_role - View template details