A job is an instance of Tower launching an Ansible playbook against an inventory of hosts.
The Jobs link displays a list of jobs and their status–shown as completed successfully or failed, or as an active (running) job.
From this screen, you can relaunch jobs, remove jobs, or view the standard output of a particular job.
Clicking on a Name for an SCM Update job opens the Job Results screen, while clicking on a manually created Playbook Run job takes you to the Job Status page for this job (also accessible after launching a job from the Job Templates link in the main Tower navigational menu).
The Job Results window displays information about jobs of type Inventory Sync and SCM Update.
This display consists of three tabs. The Status tab includes details on the job execution:
The Standard Out tab shows the full results of running the SCM Update or Inventory Sync playbook. This shows the same information you would see if you ran the Ansible playbook using Ansible from the command line, and can be useful for debugging.
The Options tab describes the details of this job:
For SCM Update jobs, this consists of the **Project* associated with the job.
For Inventory Sync jobs, this consists of:
- Credential: The cloud credential for the job
- Group: The group being synced
- Source: The type of cloud inventory
- Regions: Any region filter, if set
- Overwrite: The value of Overwrite for this Inventory Sync. Refer to Inventories for details.
- Overwrite Vars: The value of Overwrite Vars for this Inventory Sync. Refer to Inventories for details.
The Jobs page for Playbook Run jobs shows details of all the tasks and events for that playbook run.
The Jobs page consists of multiple areas: Status, Plays, Tasks, Host Events, Events Summary, and Hosts Summary.
The Status area shows the basic status of the job–Running, Pending, Successful, or Failed–and its start time. The buttons in the top right of the status page allow you to view the standard output of the job run, delete the job run, or relaunch the job.
Clicking on more
gives the basic settings for this job:
By clicking on these items, where appropriate, you can view the corresponding job templates, projects, and other Tower objects.
The Plays area shows the plays that were run as part of this playbook. The displayed plays can be filtered by Name, and can be limited to only failed plays.
For each play, Tower shows the start time for the play, the elapsed time of the play, the play Name, and whether the play succeeded or failed. Clicking on a specific play filters the Tasks and Host Events area to only display tasks and hosts relative to that play.
The Tasks area shows the tasks run as part of plays in the playbook. The displayed tasks can be filtered by Name, and can be limited to only failed tasks.
For each task, Tower shows the start time for the task, the elapsed time of the task, the task Name, whether the task succeeded or failed, and a summary of the host status for that task. The host status displays a summary of the hosts status for all hosts touched by this task. Host status can be one of the following:
Clicking on a specific task filters the Host Events area to only display hosts relative to that task.
The Host Events area shows hosts affected by the selected play and task. For each host, Tower shows the host’s status, its name, and any Item or Message set by that task.
Click the button to edit the host’s properites (hostname, description, enabled or not, and variables).
Clicking on the linked hostname brings up the Host Event dialog for that host and task.
The Host Event dialog shows the events for this host and the selected play and task:
There is also a JSON tab which displays the result in JSON format.
The Events Summary area shows a summary of events for all hosts affected by this playbook. Hosts can be filtered by their hostname, and can be limited to showing only changed, failed, OK, and unreachable hosts.
For each host, the Events Summary area shows the hostname and the number of completed tasks for that host, sorted by status.
Click the button to edit the host’s properites (hostname, description, enabled or not, and variables).
Clicking on the hostname brings up a Host Events dialog, displaying all tasks that affected that host.
This dialog can be filtered by the result of the tasks, and also by the hostname. For each event, Tower displays the status, the affected host, the play name, and the task name. Clicking on the status brings up a the same Host Event dialog that would be shown for that host and event from the Host Events area.
The Host Summary area shows a graph summarizing the status of all hosts affected by this playbook run.
Tower limits the number of simultaneous jobs that can run based on the amount of physical memory and the complexity of the playbook.
If the “Update on Launch” setting is checked, job templates that rely on the inventory or project also trigger an update on them if it is within the cache timeout. If multiple jobs are launched within the cache timeout that depend on the same project or inventory, only one of those project or inventory updates is created (instead of one for each job that relies on it).
If you are having trouble, try setting the cache timeout on the project or inventory source to 60 seconds.
The restriction related to the amount of RAM on your Tower server and the size of your inventory equates to the total number of machines from which facts can be gathered and stored in memory. The algorithm used is:
50 + ((total memory in megabytes) / 1024) - 2) * 75
With 50 as the baseline.
Each job that runs is:
(number of forks on the job) * 10
Which defaults to 50 if the limit is set to 0 in Tower, the default value.
Forks determine the default number of parallel processes to spawn when communicating with remote hosts. The fork number is automatically limited to the number of possible hosts, so this is really a limit of how much network and CPU load you can handle. Many users set this to 50, while others set it to 500 or more. If you have a large number of hosts, higher values will make actions across all of those hosts complete faster. You can edit the ansible.cfg
file to change this value.
The Ansible fork number default is extremely conservative and is set to five (5). When you do not pass a forks value in Tower (leaving it as 0), Ansible uses 5 forks (the default). If you set your forks value to one (1) in Tower, Ansible uses the value entered and one (1) fork is created. Non-zero inputs are used as instructed.
As an example, if you have a job with 0 forks (the Tower default) on a system with 2 GB of memory, your algorithm would look like the following:
50 + ((2048 / 1024) - 2) * 75 = 50
If you have a job with 0 forks (the Tower default) on a system with 4 GB of memory then you can run four (4) tasks simultaneously which includes callbacks.
50 + ((4096 / 1024) - 2) * 75 = 200
This can be changed by setting a value in the Tower settings file (/etc/tower/settings.py
) such as:
SYSTEM_TASK_CAPACITY = 300
If you want to override the setting, use caution, as you may run out of RAM if you set this value too high. You can determine what the calculated setting is by reviewing /var/log/tower/task_system.log
and looking for a line similar to:
Running Nodes: []; Capacity: 50; Running Impact: 0; Remaining Capacity: 50
The Capacity: 50
is the current calculated setting.
As long as you have the capacity to do so, Tower attempts to reorder and run the most number of jobs possible. There are some blockers and exceptions worth noting, however.