Documentation

5. Job Template Changes

Job templates have been updated in Tower 3.0 to allow you more flexibility when creating and working with them.

5.1. Prompt on Launch

In prior versions of Ansible Tower, you could set “Prompt on Launch” against Extra Varaibles that you want to potentially pass through the job template. Now, starting with version 3.0, Ansible Tower allows you to prompt for an inventory selection, job type, and more.

Selecting “Prompt on Launch” means that even if a value is supplied at the time of the job template creation, the user launching the job will be prompted to supply new information or confirm what was entered in the job template originally.

The following job template settings allow for prompting at the time of launch:

  • Job Type (run or check type jobs only, as scan jobs cannot be changed at the time of launch)
  • Inventory
  • Machine credential
  • Limit
  • Job Tags
  • Extra variables
_images/jt-overview-prompt-on-launch.png

As you work with migrating your Tower 2.4.5 job templates to 3.0, please keep in mind the following:

  • All “Prompt on Launch” fields are set to False by default after migrating to 3.0 (new job templates created also have all “Prompt on Launch” fields set to False by default).

    • With one exception for those upgrading from 2.4.5 to 3.0: if a credential used in Tower 2.4.5 was null, the credential will be prompted for in 3.0.
  • If you have Job Templates with a null credential, in the migration from 2.4.5 to 3.0, “ask_credential_on_launch” is set to True.

    • Note that there was no way to set a default credential in 2.4.5. However, in 3.0, you can set a default credential and select to prompt the user at launch time to confirm the default credential or change it to something new.
  • All other “ask_xx_on_launch” prompts are set to False.

  • Starting with Tower 3.0, if “ask_variables_on_launch” is set to False, extra variables passed at launch time (via UI or API) that are not part of an enabled survey are ignored.

  • While there are no changes to how “ask_variables_on_launch” behaves, keep in mind that these variables combine with survey answers.

5.2. Permissions/RBAC Notes

Job template visibility is no longer configured via a combination of permissions on inventory, projects, and credentials. Admins who want to give any user or team permissions to use a job template can quickly assign permissions directly on the job template. Similarly, credentials are now full objects in Tower’s RBAC system, and can be assigned to multiple users and/or teams for use.

If a job template a user has been granted execution capabilities on does not specify an inventory or credential, the user will be prompted at run-time to select among the inventory and credentials in the organization they own or have been granted usage capabilities.

Users that are job template administrators can make changes to job templates; however, to make changes to the inventory, project, playbook, or credentials used in the job template, the user must also have the “Use” role for the project, inventory, and all credentials currently being used or being set.

5.3. Surveys

In prior versions of Ansible Tower, you had to select a checkbox to “Enable Survey” on the Job Template before a button appeared allowing you to “Create Survey”.

Enabling and creating surveys is much simplier in Ansible Tower 3.0.

At the bottom of each job template is a button (add-survey) which opens a new dialog where you can enter your survey questions and reposnses.

Job template - create survey

Use the ON/OFF toggle button to quickly activate or deactivate this survey prompt.

Once you have entered the question information, click Add to add the survey prompt.

A stylized preview of the survey is presented, along with a New Question button. Click this button to add additional questions.

For any question, you can click on the Edit button to edit the question, the Delete button to delete the question, and click on the Up and Down arrow buttons to rearrange the order of the questions. Click Save to save the survey.

job-template-completed-survey