FreeKB - Ansible Create Job Template in Tower
Ansible - Create Job Template in Tower

A job templates is how you create a job to run a playbook.


From the Templates view:

  1. In the left panel of Ansible Tower, select Templates.
  2. Select the green plus icon.
  3. Select Job Template.

From a Project:

  1. In the left panel of Ansible Tower, select Project.
  2. Select the Project that you want to associate with the Job Template.
  3. Select the Job Templates button.
  4. Select the green plus icon.
  5. Select Job Template.

Create the Job Template

In the New Project form, enter the following:

  1. Name = Give your job template any name you would like
  2. Description = Optional
  3. Job Type
    • Run = actually run the playbook
    • Check = dry run the playbook
    • Scan = scan the playbook for issues
  4. Inventory = Select an inventory (refer to Ansible - Create static inventory in Tower)
  5. Project = Select a project (refer to Ansible - Create project in Tower)
  6. 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.
  7. Credentials = Select the credentials to use.
  8. Forks = Refer to Ansible --forks command line option
  9. Limit = Refer to Ansible --limit command line option
  10. Verbosity:
    • 0 = Normal
    • 1 = Verbose
    • 2 = More Verbose
    • 3 = Debug
  11. Job Tags = Refer to Ansible - Getting started with Tags
  12. Skip Tags = Refer to Ansible - Getting started with Tags
  13. Labels = tbd
  14. Optional - Create extra vars (refer to Ansible - Job template extra variables)
  15. 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

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter a374b in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |