Ansible - Create Job Template in Tower
by
Jeremy Canfield |
Updated: December 04 2020
| Ansible articles
A job templates is how you create a job to run a playbook.
From the Templates view:
- In the left panel of Ansible Tower, select Templates.
- Select the green plus icon.
- Select Job Template.
From a Project:
- In the left panel of Ansible Tower, select Project.
- Select the Project that you want to associate with the Job Template.
- Select the Job Templates button.
- Select the green plus icon.
- Select Job Template.
Create the Job Template
In the New Project form, enter the following:
- Name = Give your job template any name you would like
- Description = Optional
- Job Type
- Run = actually run the playbook
- Check = dry run the playbook
- Scan = scan the playbook for issues
- Inventory = Select an inventory (refer to Ansible - Create static inventory in Tower)
- Project = Select a project (refer to Ansible - Create project in Tower)
- Playbook = Select the playbook to run. The project determines the available playbooks. If a playbook in a project is not showing, refer to Ansible - Get latest SCM revision.
- Credentials = Select the credentials to use.
- Forks = Refer to Ansible --forks command line option
- Limit = Refer to Ansible --limit command line option
- Verbosity:
- 0 = Normal
- 1 = Verbose
- 2 = More Verbose
- 3 = Debug
- Job Tags = Refer to Ansible - Getting started with Tags
- Skip Tags = Refer to Ansible - Getting started with Tags
- Labels = tbd
- Optional - Create extra vars (refer to Ansible - Job template extra variables)
- Select Save.
In this example, a job template named foo job has been created.
You will typically want the playbook to run against all hosts, since the target managed hosts are defined in Tower.
- hosts: all
Did you find this article helpful?
If so, consider buying me a coffee over at