8000 Update Ch 6 Job Templates for UI and migration by ianf77 · Pull Request #3510 · ansible/aap-docs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update Ch 6 Job Templates for UI and migration #3510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,60 +10,66 @@ A job template is a definition and set of parameters for running an Ansible job.
Job templates are useful to run the same job many times.
They also encourage the reuse of Ansible Playbook content and collaboration between teams.

The *Automation Templates* page shows both job templates and workflow job templates that are currently available.
The default view is to show each template as a card, showing the template name and template type.
Select the template name to display more information about the tenmplate, including when it last ran.
This list is sorted alphabetically by name, but you can sort by other criteria, or search by various fields and attributes of a template.

[NOTE]
====
Search functionality for Job templates is limited to alphanumeric characters only.
====

//image::ug-job-templates-home.png[Job templates home]

From the template card you can launch image:rightrocket.png[Rightrocket,15,15], edit image:leftpencil.png[Leftpencil,15,15] a template, or, using the {MoreActionsIcon} icon, you can duplicate image:copy.png[Duplicate,15,15] or delete image:delete-button.png[Delete,15,15] a template.

Workflow templates have the workflow visualizer image:visualizer.png[Workflow visualizer,15,15] icon as a shortcut for accessing the workflow editor.

[NOTE]
====
You can use job templates to build a workflow template.
Templates that show the *Workflow Visualizer* image:visualizer.png[Visualizer, 15,15] icon next to them are workflow templates.
Clicking the icon allows you to build a workflow graphically.
Many parameters in a job template enable you to select *Prompt on Launch* that you can change at the workflow level, and do not affect the values assigned at the job template level.
For instructions, see the xref:controller-workflow-visualizer[Workflow Visualizer] section.
====
include::platform/ref-controller-intro-job-template.adoc[leveloffset=+1]

include::platform/proc-controller-create-job-template.adoc[leveloffset=+1]
:context: templates

include::platform/proc-controller-adding-permissions.adoc[leveloffset=+1]
:!context: templates

include::platform/proc-controller-delete-job-template.adoc[leveloffset=+1]

include::platform/con-controller-work-with-notifications.adoc[leveloffset=+1]

include::platform/con-controller-view-completed-jobs.adoc[leveloffset=+1]

include::platform/proc-controller-scheduling-job-templates.adoc[leveloffset=+1]

include::platform/con-controller-surveys.adoc[leveloffset=+1]

include::platform/proc-controller-create-survey.adoc[leveloffset=+2]

include::platform/ref-controller-optional-survey-questions.adoc[leveloffset=+2]

include::platform/proc-controller-launch-job-template.adoc[leveloffset=+1]

include::platform/ref-controller-job-template-variables.adoc[leveloffset=+2]

include::platform/proc-controller-copy-a-job-template.adoc[leveloffset=+1]
include::platform/con-controller-fact-scan-job-templates.adoc[leveloffset=+1]
include::platform/ref-controller-fact-scan-playbooks.adoc[leveloffset=+2]
include::platform/ref-controller-supported-oses.adoc[leveloffset=+2]
include::platform/ref-controller-pre-scan-setup.adoc[leveloffset=+2]
include::platform/ref-controller-custom-fact-scans.adoc[leveloffset=+2]< 10000 /span>
include::platform/con-controller-fact-caching.adoc[leveloffset=+2]
include::platform/con-controller-benefits-fact-caching.adoc[leveloffset=+2]

//Removed at AAP-45082 as Controller 3.2 is out of date.
//include::platform/con-controller-fact-scan-job-templates.adoc[leveloffset=+1]

include::platform/ref-controller-fact-scan-playbooks.adoc[leveloffset=+1]

include::platform/ref-controller-supported-oses.adoc[leveloffset=+1]

include::platform/ref-controller-pre-scan-setup.adoc[leveloffset=+1]

include::platform/ref-controller-custom-fact-scans.adoc[leveloffset=+1]

include::platform/con-controller-fact-caching.adoc[leveloffset=+1]

include::platform/con-controller-benefits-fact-caching.adoc[leveloffset=+1]

include::platform/con-controller-cloud-credentials.adoc[leveloffset=+1]
include::platform/ref-controller-openstack-cloud.adoc[leveloffset=+2]

include::platform/ref-controller-openstack-cloud.adoc[leveloffset=+1]

include::platform/ref-controller-aws-cloud.adoc[leveloffset=+2]

include::platform/ref-controller-google-cloud.adoc[leveloffset=+2]

include::platform/ref-controller-azure-cloud.adoc[leveloffset=+2]

include::platform/ref-controller-vmware-cloud.adoc[leveloffset=+2]

include::platform/con-controller-provisioning-callbacks.adoc[leveloffset=+1]

include::platform/proc-controller-enable-provision-callbacks.adoc[leveloffset=+2]

include::platform/proc-controller-pass-extra-variables-provisioning-callbacks.adoc[leveloffset=+2]

include::platform/ref-controller-extra-variables.adoc[leveloffset=+1]

include::platform/con-controller-relaunch-job-template.adoc[leveloffset=+2]
5 changes: 3 additions & 2 deletions downstream/modules/platform/con-controller-surveys.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ Surveys set extra variables for the playbook similar to *Prompt for Extra Variab
Surveys also permit for validation of user input.
Select the *Survey* tab to create a survey.

.Example
*Example*

You can use surveys for several situations.
For example, operations want to give developers a "push to stage" button that they can run without advance knowledge of Ansible.
When launched, this task could prompt for answers to questions such as "What tag should we release?".

You can ask many types of questions, including multiple-choice questions.
You can ask many types of questions, including multiple-choice questions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[id="controller-adding-permissions_{context}"]
[id="proc-controller-adding-permissions"]

= Adding permissions to templates

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,37 @@ Exceptions are noted in the following table.
[cols="33%,33%,33%",options="header"]
|===
| *Field* | *Options* | *Prompt on Launch*
| Name | Enter a name for the job.| N/A
| Description| Enter an arbitrary description as appropriate (optional). | N/A
| Job type a| Choose a job type:
| *Name* | Enter a name for the job.| N/A
| *Description* | Enter an arbitrary description as appropriate (optional). | N/A
| *Job type* a| Choose a job type:

- Run: Start the playbook when launched, running Ansible tasks on the selected hosts.

- Check: Perform a "dry run" of the playbook and report changes that would be made without actually making them.
Tasks that do not support check mode are missed and do not report potential changes.

For more information about job types see the link:https://docs.ansible.com/ansible/latest/playbook_guide/index.html[Playbooks] section of the Ansible documentation.| Yes
| Inventory | Choose the inventory to use with this job template from the inventories available to the logged in user.
| *Inventory* | Choose the inventory to use with this job template from the inventories available to the logged in user.

A System Administrator must grant you or your team permissions to be able to use certain inventories in a job template. | Yes.

Inventory prompts show up as its own step in a later prompt window.
| Project | Select the project to use with this job template from the projects available to the user that is logged in. | N/A
| Source control branch | This field is only present if you chose a project that allows branch override.
| *Project* | Select the project to use with this job template from the projects available to the user that is logged in. | N/A
| *Source control branch* | This field is only present if you chose a project that allows branch override.
Specify the overriding branch to use in your job run.
If left blank, the specified SCM branch (or commit hash or tag) from the project is used.

For more information, see xref:controller-job-branch-overriding[Job branch overriding]. | Yes
| Playbook | Choose the playbook to be launched with this job template from the available playbooks.
| *Playbook* | Choose the playbook to be launched with this job template from the available playbooks.
This field automatically populates with the names of the playbooks found in the project base path for the selected project.
Alternatively, you can enter the name of the playbook if it is not listed, such as the name of a file (such as foo.yml) you want to use to run with that playbook.
If you enter a filename that is not valid, the template displays an error, or causes the job to fail. | N/A
| Execution Environment | Select the container image to be used to run this job.
| *Execution Environment* | Select the container image to be used to run this job.
You must select a project before you can select an {ExecEnvShort}. | Yes.

Execution environment prompts show up as its own step in a later prompt window.

| Credentials | Select the image:examine.png[examine,15,15] icon to open a separate window.
| *Credentials* | Select the image:examine.png[examine,15,15] icon to open a separate window.

Choose the credential from the available options to use with this job template.

Expand All @@ -66,7 +66,7 @@ for the following types in order to proceed: Machine.`
- You can add more credentials as you see fit.

- Credential prompts show up as its own step in a later prompt window.
| Labels a| - Optionally supply labels that describe this job template, such as `dev` or `test`.
| *Labels* a| - Optionally supply labels that describe this job template, such as `dev` or `test`.

- Use labels to group and filter job templates and completed jobs in the display.

Expand All @@ -82,9 +82,9 @@ When a label is removed, it is no longer associated with that particular Job or
- Jobs inherit labels from the Job Template at the time of launch.
If you delete a label from a Job Template, it is also deleted from the Job. a| - If selected, even if a default value is supplied, you are prompted when launching to supply additional labels, if needed.
- You cannot delete existing labels, selecting image:disassociate.png[Disassociate,10,10] only removes the newly added labels, not existing default labels.
| Forks | The number of parallel or simultaneous processes to use while executing the playbook.
| *Forks* | The number of parallel or simultaneous processes to use while executing the playbook.
A value of zero uses the Ansible default setting, which is five parallel processes unless overridden in `/etc/ansible/ansible.cfg`. | Yes
| Limit a| A host pattern to further constrain the list of hosts managed or affected by the playbook. You can separate many patterns by colons (:).
| *Limit* a| A host pattern to further constrain the list of hosts managed or affected by the playbook. You can separate many patterns by colons (:).
As with core Ansible:

* a:b means "in group a or b"
Expand All @@ -95,24 +95,24 @@ For more information, see link:https://docs.ansible.com/ansible/latest/inventory

If not selected, the job template executes against all nodes in the inventory or only the nodes predefined on the *Limit* field.
When running as part of a workflow, the workflow job template limit is used instead.
| Verbosity | Control the level of output Ansible produces as the playbook executes.
| *Verbosity* | Control the level of output Ansible produces as the playbook executes.
Choose the verbosity from Normal to various Verbose or Debug settings.
This only appears in the *details* report view.
Verbose logging includes the output of all commands.
Debug logging is exceedingly verbose and includes information about SSH operations that can be useful in certain support instances.

Verbosity `5` causes {ControllerName} to block heavily when jobs are running, which could delay reporting that the job has finished (even though it has) and can cause the browser tab to lock up.| Yes
| Job slicing | Specify the number of slices you want this job template to run.
| *Job slicing* | Specify the number of slices you want this job template to run.
Each slice runs the same tasks against a part of the inventory.
For more information about job slices, see xref:controller-job-slicing[Job Slicing]. | Yes
| Timeout a| This enables you to specify the length of time (in seconds) that the job can run before it is canceled. Consider the following for setting the timeout value:
| *Timeout* a| This enables you to specify the length of time (in seconds) that the job can run before it is canceled. Consider the following for setting the timeout value:

- There is a global timeout defined in the settings which defaults to 0, indicating no timeout.
- A negative timeout (<0) on a job template is a true "no timeout" on the job.
- A timeout of 0 on a job template defaults the job to the global timeout (which is no timeout by default).
- A positive timeout sets the timeout for that job template. | Yes
| Show changes | Enables you to see the changes made by Ansible tasks. | Yes
| Instance groups | Choose xref:controller-instance-and-container-groups[Instance and Container Groups] to associate with this job template.
| *Show changes* | Enables you to see the changes made by Ansible tasks. | Yes
| *Instance groups* | Choose xref:controller-instance-and-container-groups[Instance and Container Groups] to associate with this job template.
If the list is extensive, use the image:examine.png[examine,15,15] icon to narrow the options.
Job template instance groups contribute to the job scheduling criteria, see link:{URLControllerAdminGuide}/controller-clustering#controller-cluster-job-runtime[Job Runtime Behavior] and xref:controller-control-job-run[Control where a job runs] for rules.
A System Administrator must grant you or your team permissions to be able to use an instance group in a job template.
Expand All @@ -123,11 +123,11 @@ If selected, you are providing the jobs preferred instance groups in order of pr
- If you prompt for an instance group, what you enter replaces the normal instance group hierarchy and overrides all of the organizations' and inventories' instance groups.

- The Instance Groups prompt shows up as its own step in a later prompt window.
| Job tags | Type and select the *Create* menu to specify which parts of the playbook should be executed.
| *Job tags* | Type and select the *Create* menu to specify which parts of the playbook should be executed.
For more information and examples see link:https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_tags.html[Tags] in the Ansible documentation. | Yes
| Skip tags | Type and select the *Create* menu to specify certain tasks or parts of the playbook to skip.
| *Skip tags* | Type and select the *Create* menu to specify certain tasks or parts of the playbook to skip.
For more information and examples see link:https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_tags.html[Tags] in the Ansible documentation. | Yes
| Extra variables a| - Pass extra command line variables to the playbook.
| *Extra variables* a| - Pass extra command line variables to the playbook.
This is the "-e" or "-extra-vars" command line parameter for ansible-playbook that is documented in the Ansible documentation at link:https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html#defining-variables-at-runtime[Defining variables at runtime].
- Give key or value pairs by using either YAML or JSON.
These variables have a maximum value of precedence and overrides other variables specified elsewhere.
Expand Down Expand Up @@ -172,7 +172,7 @@ You must first save the template before launching, otherwise, btn:[Launch templa

//image::ug-job-template-details.png[Job template details]

.Verification
*Verification*

. From the navigation panel, select {MenuAETemplates}.
. Verify that the newly created template appears on the *Templates* page.
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ Before deleting a job template, ensure that it is not used in a workflow job tem
.Procedure

. Delete a job template using the following method:
* Click the {MoreActionsIcon} icon and select the Delete Templateimage:delete-button.png[Delete Template,15,15] icon.
* Click the {MoreActionsIcon} icon and select the Delete Template image:delete-button.png[Delete Template,15,15] icon, or
* Select the required job template, on the *Details* page click the {MoreActionsIcon} icon and select image:delete-button.png[Delete template,15,15] btn:[Delete template].

[NOTE]
====
If deleting items that are used by other work items, a message opens listing the items that are affected by the deletion and prompts you to confirm the deletion.
Some screens contain items that are invalid or previously deleted, and will fail to run. The following is an example of that message:
Some screens contain items that are invalid or previously deleted, and will fail to run.
//The following is an example of that message:

//image::ug-warning-deletion.png[Deletion warning]
====
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Easier deployments drive consistency, by running your playbooks the same way eac
.Procedure

* Launch a job template by using one of these methods:
** From the navigation panel, select {MenuAETemplates} and click *Launch template* image:rightrocket.png[Rightrocket,15,15] on the job template card.
** From the navigation panel, select {MenuAETemplates} and click *Launch template* image:rightrocket.png[Launch,15,15] on the job template card.
+
//image::ug-job-template-launch.png[Job template launch]
+
Expand Down
Loading
0