Create repeatable, shareable job templates to standardize automation runs

A job template is a definition and set of parameters for running an Ansible job. Use job templates to launch jobs.

Procedure

  1. From the navigation panel, select Automation Execution > Templates.
  2. On the Automation Templates page, select Create job template from the Create template list.
  3. Enter the appropriate details in the following fields:
    Note

    If a field has the Prompt on launch checkbox selected, launching the job prompts you for the value for that field when launching.

    Most prompted values override any values set in the job template.

    Note the exceptions in the following table.

    Expand
    Field Options Prompt on Launch

    Name

    Enter a name for the job.

    N/A

    Description

    Enter an arbitrary description as appropriate (optional).

    N/A

    Job type

    Choose a job type:

    • Run: Start the playbook when launched, running Ansible tasks on the selected hosts.
    • Check: Perform a "dry run" of the playbook and report changes that would be made without actually making them. Tasks that do not support check mode are missed and do not report potential changes.

    For more information about job types see the Jobs in automation controller.

    Yes

    Inventory

    Choose the inventory to use with this job template from the inventories available to the logged in user.

    A System Administrator must grant you or your team permissions to be able to use certain inventories in a job template.

    Yes

    Inventory prompts show up as its own step in a later prompt window.

    Project

    Select the project to use with this job template from the projects available to the user that is logged in.

    N/A

    Source control branch

    This field is only present if you chose a project that allows branch override. Specify the overriding branch to use in your job run. If left blank, the specified SCM branch (or commit hash or tag) from the project is used.

    For more information, see Job branch overriding.

    Yes

    Playbook

    Choose the playbook to be launched with this job template from the available playbooks. This field automatically populates with the names of the playbooks found in the project base path for the selected project. Alternatively, you can enter the name of the playbook if it is not listed, such as the name of a file (such as test.yml) you want to use to run with that playbook. If you enter a filename that is not valid, the template displays an error, or causes the job to fail.

    N/A

    Execution Environment

    Select the container image to be used to run this job. You must select a project before you can select an execution environment.

    Yes

    Execution environment prompts show up as its own step in a later prompt window.

    Credentials

    Select the examine icon to open a separate window.

    Choose the credential from the available options to use with this job template.

    Use the drop-down menu list to filter by credential type if the list is extensive. Some credential types are not listed because they do not apply to certain job templates.

    • If selected, when launching a job template that has a default credential and supplying another credential replaces the default credential if it is the same type. The following is an example this message:

    Job Template default credentials must be replaced with one of the same type. Please select a credential for the following types in order to proceed: Machine.

    • You can add more credentials as you see fit.
    • Credential prompts show up as its own step in a later prompt window.

    Labels

    • Optionally supply labels that describe this job template, such as dev or test.
    • Use labels to group and filter job templates and completed jobs in the display.
    • Labels are created when they are added to the job template. Labels are associated with a single Organization by using the Project that is provided in the job template. Members of the Organization can create labels on a job template if they have edit permissions (such as the admin role).
    • Once you save the job template, the labels appear in the Job Templates overview in the Expanded view.
    • Select Disassociate beside a label to remove it. When a label is removed, it is no longer associated with that particular Job or Job Template, but it remains associated with any other jobs that reference it.
    • Jobs inherit labels from the Job Template at the time of launch. If you delete a label from a Job Template, it is also deleted from the Job.
    • If selected, even if a default value is supplied, you are prompted when launching to supply additional labels, if needed.
    • You cannot delete existing labels, selecting Disassociate only removes the newly added labels, not existing default labels.

    Forks

    The number of parallel or simultaneous processes to use while executing the playbook. A value of zero uses the Ansible default setting, which is five parallel processes unless overridden in /etc/ansible/ansible.cfg.

    Yes

    Limit

    A host pattern to further constrain the list of hosts managed or affected by the playbook. You can separate many patterns by colons (:). As with core Ansible:

    • a:b means "in group a or b"
    • a:b:&c means "in a or b but must be in c"
    • a:!b means "in a, and definitely not in b"

    If not selected, the job template executes against all nodes in the inventory or only the nodes predefined on the Limit field. When running as part of a workflow, the workflow job template limit is used instead.

    Verbosity

    Control the level of output Ansible produces as the playbook executes. Choose the verbosity from Normal to various Verbose or Debug settings. This is only displayed in the details report view. Verbose logging includes the output of all commands. Debug logging is exceedingly verbose and includes information about SSH operations that can be useful in certain support instances.

    Verbosity 5 causes automation controller to block heavily when jobs are running, which could delay reporting that the job has finished (even though it has) and can cause the browser tab to lock up.

    Yes

    Job slicing

    Specify the number of slices you want this job template to run. Each slice runs the same tasks against a part of the inventory. For more information about job slices, see Job Slicing.

    Yes

    Timeout

    This enables you to specify the length of time (in seconds) that the job can run before it is canceled. Consider the following for setting the timeout value:

    • There is a global timeout defined in the settings which defaults to 0, indicating no timeout.
    • A negative timeout (<0) on a job template is a true "no timeout" on the job.
    • A timeout of 0 on a job template defaults the job to the global timeout (which is no timeout by default).
    • A positive timeout sets the timeout for that job template.

    Yes

    Show changes

    Enables you to see the changes made by Ansible tasks.

    Yes

    Instance groups

    Choose Instance and Container Groupsto associate with this job template. If the list is extensive, use the examine icon to narrow the options. Job template instance groups contribute to the job scheduling criteria, see Job Runtime Behavior and Control where a job runs for rules. A System Administrator must grant you or your team permissions to be able to use an instance group in a job template. Use of a container group requires admin rights.

    Yes

    If selected, you are providing the jobs preferred instance groups in order of preference. If the first group is out of capacity, later groups in the list are considered until one with capacity is available, at which point that is selected to run the job.

    • If you prompt for an instance group, what you enter replaces the normal instance group hierarchy and overrides all of the organizations' and inventories' instance groups.
    • The Instance Groups prompt shows up as its own step in a later prompt window.

    Job tags

    Type and select the Create menu to specify which parts of the playbook should be executed.

    Yes

    Skip tags

    Type and select the Create menu to specify certain tasks or parts of the playbook to skip.

    Yes

    Extra variables

    • Pass extra command line variables to the playbook. This is the "-e" or "-extra-vars" command line parameter for ansible-playbook.
    • Give key or value pairs by using either YAML or JSON. These variables have a maximum value of precedence and overrides other variables specified elsewhere. The following is an example value: git_branch: production release_version: 1.5

    Yes

    If you want to be able to specify extra_vars on a schedule, you must select Prompt on launch for Variables on the job template, or enable a survey on the job template. Those answered survey questions become extra_vars.

  4. You can set the following options for launching this template, if necessary:
    • Privilege escalation: If checked, you enable this playbook to run as an administrator. This is the equal of passing the --become option to the ansible-playbook command.
    • Provisioning callback: If checked, you enable a host to call back to automation controller through the REST API and start a job from this job template. For more information, see Provisioning Callbacks.
    • Enable webhook: If checked, you turn on the ability to interface with a predefined SCM system web service that is used to launch a job template. GitHub and GitLab are the supported SCM systems.
      • If you enable webhooks, other fields display, prompting for additional information:
      • Webhook service: Select which service to listen for webhooks from.
      • Webhook URL: Automatically populated with the URL for the webhook service to POST requests to.
      • Webhook key: Generated shared secret to be used by the webhook service to sign payloads sent to automation controller. You must configure this in the settings on the webhook service in order for automation controller to accept webhooks from this service.
      • Webhook credential: Optionally, give a GitHub or GitLab personal access token (PAT) as a credential to use to send status updates back to the webhook service.

        Before you can select it, the credential must exist.

        See Credential types to create one.

      • For additional information about setting up webhooks, see Working with Webhooks.
    • Concurrent jobs: If checked, you are allowing jobs in the queue to run simultaneously if not dependent on one another. Check this box if you want to run job slices simultaneously. For more information, see Automation controller capacity determination and job impact.
    • Enable fact storage: If checked, automation controller stores gathered facts for all hosts in an inventory related to the job running.
    • Prevent instance group fallback: Check this option to allow only the instance groups listed in the Instance Groups field to run the job. If clear, all available instances in the execution pool are used based on the hierarchy described in Control where a job runs.
  5. Click Create job template, when you have completed configuring the details of the job template.

    Creating the template does not exit the job template page but advances to the Job Template Details tab.

    After saving the template, you can click Launch template to start the job. You can also click Edit to add or change the attributes of the template, such as permissions, notifications, view completed jobs, and add a survey (if the job type is not a scan). You must first save the template before launching, otherwise, Launch template remains disabled.

Results

  1. From the navigation panel, select Automation Execution > Templates.
  2. Verify that the newly created template is displayed on the Templates page.

Automation templates

The Automation Templates page shows both job templates and workflow job templates that are currently available.

Automation Templates serve as a powerful blueprint for automating and orchestrating complex IT tasks.

Whether defined as a Job Template or Workflow Template, they standardize and streamline routine operations, enabling consistent execution across various environments.

By specifying playbooks, inventory, credentials, and other configuration details, an Automation Template eliminates manual intervention, reduces errors, and accelerates task completion.

It also provides flexibility by allowing the chaining of multiple tasks in a Workflow Template, supporting sophisticated automation use cases that can span across multiple systems and processes.

This ensures IT teams can reliably scale automation while maintaining high efficiency and control.

The default view is collapsed (Compact), showing the template name, template type, and the timestamp of the last job that ran using that template. You can click the Arrow icon next to each entry to expand and view more information. This list is sorted alphabetically by name, but you can sort by other criteria, or search by various fields and attributes of a template.

From this screen you can launch Launch icon , edit Edit icon, and duplicate Duplicate icon a job template.

Select the template name to display more information about the template, including when it last ran.

This list is sorted alphabetically by name, but you can sort by other criteria, or search by various fields and attributes of a template.

Note

Search functionality for Job templates is limited to alphanumeric characters only.

Workflow templates have the workflow visualizer Workflow visualizer icon as a shortcut for accessing the workflow editor.

Note

You can use job templates to build a workflow template. Templates that show the Workflow VisualizerVisualizer icon next to them are workflow templates. Clicking the icon allows you to build a workflow graphically. Many parameters in a job template enable you to select Prompt on Launch that you can change at the workflow level, and do not affect the values assigned at the job template level. For instructions, see the Workflow Visualizer section.

Add permissions to templates

You can add permissions to a template to allow specific users or teams to have access to it.

About this task

Use the following steps to add permissions for the team.

Procedure

  1. From the navigation panel, select Automation Execution > Templates.
  2. Select a template, and in the Team Access or User Access tab, click Add roles.
  3. Select Teams or Users and click Next.
    • Select one or more users or teams from the list by clicking the check boxes next to the names to add them as members and click Next.
  4. Choose the roles that you want users or teams to have. Ensure that you scroll down for a complete list of roles. Each resource has different options available.
  5. Click Finish to apply the roles to the selected users or teams and to add them as members.

    The window to add users and teams closes to display the updated roles assigned for each user and team

  6. To remove roles for a particular user, click the Disassociate icon next to its resource.

    This launches a confirmation dialog, asking you to confirm the disassociation.

Set your domains of interest

With Domain filtering lets you customize content in Automation Execution's Jobs and Templates sections. Jobs and templates are linked to labels; selecting one filters out less-relevant items, providing easy access to resources tailored to your specific area of interest.

Procedure

  1. From the navigation panel, select Automation Execution > Jobs or Automation Execution > Templates.
  2. Beneath the page heading, next to Domains, is a list of topic-related labels. Select a label to filter jobs and job templates so that only content related to the labels is shown. You can choose more than one label.
  3. To clear your selection, click the X.
  4. To customize your domain options, select the Wrench icon. In the modal that appears, select Add Domain to add new domains to filter with.

What to do next

You can add labels to your individual job templates to make the templates appear as resources when you filter with the related domain label. Go to Automation Execution > Templates, select your job template, and click Edit template. On the editing screen, enter the label you want to use in the Labels field and click Save job template.

Schedule job templates

You can schedule job templates in automation controller to run at specific times or intervals.

About this task

Access the schedules for a particular job template from the Schedules tab.

Procedure

  • To schedule a job template, select the Schedules tab from the job template, and select the appropriate method:
    • If schedules are already set up, review, edit, enable or disable your schedule preferences.
    • If schedules have not been set up, see Schedules for more information.
  • If you select Prompt on Launch for the Credentials field, and you create or edit scheduling information for your job template, a Prompt option displays on the Schedules form.

    You cannot remove the default machine credential in the Prompt dialog without replacing it with another machine credential before you can save it.

    Note

    To set extra_vars on schedules, you must select Prompt on Launch for Variables on the job template, or configure and enable a survey on the job template.

    The answered survey questions then become extra_vars.