# How to run multiple playbooks concurrently in parallel

**URL:** <https://forum.ansible.com/t/how-to-run-multiple-playbooks-concurrently-in-parallel/38805>\
**Category:** Ansible Project\
**Created:** [June 7, 2024, 9:46pm UTC](https://forum.ansible.com/t/how-to-run-multiple-playbooks-concurrently-in-parallel/38805 "2024-06-07T21:46:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Poseidon\_Olympian](https://avatars.discourse-cdn.com/v4/letter/p/e274bd/32.png) [@Poseidon\_Olympian](https://forum.ansible.com/u/Poseidon_Olympian)\
**Post date:** [June 7, 2024, 9:46pm UTC](https://forum.ansible.com/t/how-to-run-multiple-playbooks-concurrently-in-parallel/38805/1 "2024-06-07T21:46:56Z")

</div>

Hello Group,

Is there a way that I can run a playbook concurrently?

Currently, if I’m running the script with multiple playbook (2x or 3x or so), it will run and finish the first playbook before proceeding on the next playbook in the line.

The idea is that I want to run a script that has multiple playbooks (2x or 3x or so) concurrently in parallel at the same time. Meaning, the job1, job2, job3, and job4 will run at the same time and should NOT wait to finish each other.

Any help and guidance is highly appreciated.

An example of the scenarios are below.

Scenarios  
shell script

/home/fuser/scripts/ansbile/playbooks/servers/server\_job.sh

server\_job.sh

ansible-playbook main\_job.yml -e “server=job1” --limit runtime-host-group  
ansible-playbook main\_job.yml -e “server=job2” --limit runtime-host-group  
ansible-playbook main\_job.yml -e “server=job3” --limit runtime-host-group  
ansible-playbook main\_job.yml -e “server=job4” --limit runtime-host-group

runtime-host-group

[runtime-host-group]  
runtime001  
runtime002

main\_job.yml (using import\_playbook)

- name: Playbook to Stop/Start  
hosts: all

- name: Stop-Runtime | Stop the Runtime  
import\_playbook: “/home/fuser/scripts/ansbile/playbooks/servers/playbook\_sbxrun\_runtime\_stop\_systemCTL.yml”

- name: Start-Runtime | Start the Runtime  
import\_playbook: “/home/fuser/scripts/ansbile/playbooks/servers/playbook\_sbxrun\_runtime\_start\_systemCTL.yml”

playbook\_sbxrun\_runtime\_stop\_systemCTL.yml

- name: Process to STOP  
hosts: all

tasks:

- name: SystemCTL | STOP  
service:  
name: “{{ item }}”  
state: stopped  
become: yes  
with\_items:

- runtime-{{server}}.service

- monitor-{{server}}.service

playbook\_sbxrun\_runtime\_start\_systemCTL.yml

- name: Process to START  
hosts: all

tasks:

- name: SystemCTL | STOP  
service:  
name: “{{ item }}”  
state: started  
become: yes  
with\_items:

- runtime-{{server}}.service

- monitor-{{server}}.service

Thank you…

Erwin

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [June 7, 2024, 10:12pm UTC](https://forum.ansible.com/t/how-to-run-multiple-playbooks-concurrently-in-parallel/38805/2 "2024-06-07T22:12:19Z")

</div>

Try this:  
server\_job.sh

---

<div class="post-metadata">

**Author:** ![Poseidon\_Olympian](https://avatars.discourse-cdn.com/v4/letter/p/e274bd/32.png) [@Poseidon\_Olympian](https://forum.ansible.com/u/Poseidon_Olympian)\
**Post date:** [June 10, 2024, 8:06pm UTC](https://forum.ansible.com/t/how-to-run-multiple-playbooks-concurrently-in-parallel/38805/3 "2024-06-10T20:06:03Z")

</div>

Thank you so much again Todd. It works and confirmed.
