Job templates have been updated in Tower to allow you more flexibility when creating and working with them.
If you maintained scan job templates in Ansible Tower 3.1.x and then upgrade to Ansible Tower 3.2, a new “Tower Fact Scan - Default” project is automatically created for you. This project contains the old scan playbook previously used in earlier versions of Ansible Tower.
In prior versions of Ansible Tower, you could set “Prompt on Launch” against Extra Variables that you want to potentially pass through the job template. 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:
As you work with migrating your Tower 2.4.5 job templates to 3.x, please keep in mind the following:
All “Prompt on Launch” fields are set to False by default after migrating to 3.x (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.x: if a credential used in Tower 2.4.5 was null, the credential will be prompted for in 3.x.
If you have Job Templates with a null credential, in the migration from 2.4.5 to 3.x, “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.x, 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.x, 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.
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.
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.
At the bottom of each job template is a button () which opens a new dialog where you can enter your survey questions and reposnses.
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.