Skip to content

Templates#

A job template is a definition and set of parameters for running an Ansible job.

Ansible Tower Job Template Documentation Note: Does not perfectly translate to AWX

Templates set up run jobs for your ansible playbooks.

Setup#

You will need:

  1. A Project setup in Tower that has the playbook you'd like to run.
  2. The inventory you'd like to run the playbook against
  3. A 'machine' type credential for connecting to your linux hosts. It is recommended you do not use your own credentials for this and instead have a dedicated user.
    • NOTE: For jointly managed servers, DevEx will set up the awx_user machine credential in Tower and SSH Keys on the servers. We are looking to automate this process, but in the meantime, please fill out this form to have the awx_user added to additional jointly managed VMs.

Other things to consider are:

  • What other credentials do you need to include in your template for your playbook to reference?
  • How are you handling secrets in your playbook?
  • Do you want to limit the playbook run to specific groups? Add these in 'Limit'
  • Do you want to include any tags? Add these in 'Tags'
  • Execution Environment (Optional)
  • If you are Leveraging HashiCorp Vault to store secrets that Tower will be using, the environment needs the hvac python module. This is not provided in the default environment, however you can select devex-ee and it will have it.
  • Also, some common roles/collections are included so you don't need to call them out in the requirements.yml file

Jobs#

A template can be run to start a run job at any point by clicking the rocket ship icon anywhere it is visible.

You can schedule jobs to run using a template through the schedules tab in the template details.

Scheduled Jobs#

Jobs can be scheduled to run from the 'Schedules' in a configured template.

Please limit scheduled runs for non-production to once an hour.