-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Sliced Job Template creates number of jobs as per the slicing count for the limited host #2893
Comments
This is very similar to a problem I've raised with Red Hat support on behalf of my client - although I'm not sure what SJT is. I suggested that AWX be modified to either:
|
SJT might mean Sliced Job Template. |
The reason this happens is that ansible-playbook doesn't like being told to run for zero hosts; ansible-runner doesn't detect that situation (and is unwilling to change that behavior) and passes the failure upwards. Possible approaches for a fix include
|
Patch awx-runner to not fail when running for zero hosts. This sort of matches the first bullet point in ansible/awx#2893 (comment)
Another possible idea is to allow the number to be selected with "prompt on launch." Of course that would only help with known quantities. |
It would also require unnecessary manual action on behalf of the user. EDIT and as to say if a user just clicks to re run on failed hosts they may not even be aware of how many there are. |
Sure, I'm thinking in the case where you might normally want it split across 3 nodes, but then need to override for 1. Seems silly to have separate workflows to control that single variable. or change/saving each time. Or in the middle of a workflow where you know you only want it on less than the normal. Not the full solution for sure, but would be handy. |
Given that ansible/ansible#76438 was rejected, and Controller as it is does not really have a way of knowing how many hosts may match a filter -- AFAIK the filter is passed to ansible and doesn't apply until runtime of the job -- controller makes its decision about how many slices to create BEFORE the filter is applied. The only thing I think we could possibly do since we've not been able to land fixes in ansible and runner is do some kind of preliminary "apply the filter to the inventory and see how many match" step. This would almost be like a inventory update before the sliced job with a limit spawns its slices. I'm thinking:
I'm sure we could do something more elegant, but hacky way to do the inventory like update now might be approximated by what I can do on the CLI: given an inventory file named
This inventory has 103 hosts. But if I run
I get the output:
Which tells me of my inventory with 103 hosts, only 1 matches the limit |
ISSUE TYPE
COMPONENT NAME
SUMMARY
SJT creates number of jobs as per the slicing count for the limited hosts.
ENVIRONMENT
STEPS TO REPRODUCE
Create a Inventory with multiple hosts
Create a SJT with multiple slices and select the above created Inventory
Now, Limit the SJT for one of the hosts from the provided Inventory
Launch the SJT
EXPECTED RESULTS
Only one job is created for the limited hosts even if the Job Slicing value is >1.
ACTUAL RESULTS
Multiple jobs are created for the limited hosts as per the Job Slicing count.
ADDITIONAL INFORMATION
Even if multiple jobs are created, only one succeeds rest everything fails with
ERROR! Specified hosts and/or --limit does not match any hosts
.The text was updated successfully, but these errors were encountered: