A sliced job refers to the concept of a distributed job. Distributed jobs are used for running a job across a very large number of hosts, allowing you to run multiple ansible-playbooks, each on a subset of an inventory, that can be scheduled in parallel across a cluster.
By default, Ansible runs jobs from a single control instance. Prior to Ansible Tower 3.4, a single Tower job would only be run as a single ansible-playbook run, which would not fully take advantage of Tower’s ability to distribute work to multiple nodes in a cluster.
For jobs that do not require cross-host orchestration, job slicing solves this. Job slicing works by adding a Job Template field
job_slice_count, which specifies the number of jobs into which to slice the Ansible run. When this number is greater than 1, Tower will generate a workflow from a job template instead of a job. The inventory will be distributed evenly amongst the slice jobs. The workflow job is then started, and proceeds as though it were a normal workflow. When launching a job, the API will return either a job resource (if
job_slice_count = 1) or a workflow job resource. The corresponding Tower User Interface will redirect to the appropriate screen to display the status of the run.
Consider the following when setting up job slices:
Any job that intends to orchestrate across hosts (rather than just applying changes to individual hosts) should not be configured as a slice job. Any job that does, may fail, and Tower will not attempt to discover or account for playbooks that fail when run as slice jobs.
When jobs are sliced, they can run on any Tower node and some may not run at the same time (insufficient capacity in the system, for example). When slice jobs are running, job details display the workflow and job slice(s) currently running, as well as a link to view their details individually.
By default, job templates are not normally configured to execute simultaneously (
allow_simultaneous must be checked in the API or Enable Concurrent Jobs in the UI). Slicing overrides this behavior and implies
allow_simultaneous even if that setting is unchecked. See Job Templates for information on how to specify this, as well as the number of job slices on your job template configuration.
The Job Templates section provides additional detail on performing the following operations in the Tower User Interface:
To make it easier to find slice jobs, use the Search functionality to apply a search filter to:
To show only slice jobs in job lists, as with most cases, you can filter either on the type (jobs here) or
To show only parent workflow jobs of job slices:
To show only job templates that produce slice jobs: