Ansible Tower/AWX bug? Job task runs serially instead of parallel

1.7k views Asked by At

I have a very generic playbook with no hard coded info whatsoever. Everything in the playbook is a variable and filled out by supplying extra vars, even host names for connections. There are no inventory files in use since the host this is run against is random usually.

On a command line in linux, I can run my ansible playbook multiple times with different variables passed and they will all run at the same time.

ansible-playbook cluster_check_build.yml -e {"host": "host1"...}

ansible-playbook cluster_check_build.yml -e {"host": "host2"...}

In tower however, if I create a job template and use the same playbook then things run serially. I call that job template multiple times using the API and passing the data as JSON. Each time I called the API to launch the job task I am supplying new extra_vars so the job task is running against different hosts. I see the jobs run serially and not parallel like from the command line.

I have 400+ hosts that need to have the same playbook run against them at random times. This playbook can take an hour or so to complete. There can be times where the playbook needs to run against 20 or 30 random hosts. Time is crucial and serial Job processing is a non starter.

Is it possible to run the same job template against different hosts in parallel? IF the answer is no then what are my options? Hopefully not creating 400+ job templates. That seems like it defeats the purpose of a very generic playbook.

2

There are 2 answers

2
Kenneth.M On

Yes, you can run templates/playbooks against multiple hosts in parallel in Tower/AWX.

These are the situations where your template will run serially:

  • "forks" set to 1 in your template
  • SERIAL=1 within your playbook
  • Your Tower/AWX instance is setup with only 1 fork
  • Your Instance is set with >1 forks but other jobs are running at the same time.
0
Matt On

I feel like an absolute fool. In the bottom right of my job template is a tiny check box that says "ENABLE CONCURRENT JOBS" <---this was the fix.