ansible / awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.
Other
14.11k stars 3.43k forks source link

Job slicing does not respect host limit, leading to unnecessary job failures #15589

Open jangel97 opened 1 month ago

jangel97 commented 1 month ago

Please confirm the following

Bug Summary

I have a job template that runs against approximately 50 hosts. To speed up execution, I've set Job Slicing to 5, which effectively runs 5 parallel jobs against 10 hosts each.

However, when I run this job template with a limit set to target only 2 hosts, the job still creates 5 slices. As a result:

This behavior causes the overall job to report failures, and since I have alerting configured, I receive unnecessary failure notifications.

My deployment of AAP is in VMs.

AWX version

AAP 2.4

Select the relevant components

Installation method

N/A

Modifications

no

Ansible version

No response

Operating system

RHEL 8

Web browser

No response

Steps to reproduce

  1. Create a job template with Job Slicing set to 5.
  2. Set a limit to target a small number of hosts (e.g., 2 hosts).
  3. Launch the job template.
  4. Observe that multiple slices fail due to having no hosts assigned.

Expected results

When a limit is set that results in fewer hosts than the number of slices, AWX should adjust the number of slices accordingly. In this case, it should:

Actual results

Additional information

Perhaps this is fixed in AAP 2.5?

jangel97 commented 1 month ago

I am willing to discuss about implementation details and create PR for this, if it makes sense to fix this

jangel97 commented 2 weeks ago

@fosterseth @shanemcd does this make sense to you? Thx!