Network Automation     Archive

Cleaning up pending Tower Jobs

This post is a quick troubleshooting gist based on a recent problem I encountered. I had an external system make API calls to Ansible Tower and trigger a job template. Pretty standard stuff…however, the configuration on the remote system was, ummm, not very accurate and I ended up with a ton of API calls to my Tower machine.

This caused the jobs to go into a pending status and I could no longer trigger any of my normal jobs. I found the following snippet of Python code from that does the trick!

from awx.main.models import UnifiedJob
for i in UnifiedJob.objects.filter():
   if(i.status == 'pending'):


Hope this helps you too!