# Can I run plays in parallel?

**URL:** <https://forum.ansible.com/t/can-i-run-plays-in-parallel/31145>\
**Category:** Ansible Project\
**Created:** [August 27, 2019, 8:21pm UTC](https://forum.ansible.com/t/can-i-run-plays-in-parallel/31145 "2019-08-27T20:21:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_Kakouros](https://avatars.discourse-cdn.com/v4/letter/n/d26b3c/32.png) [@Nick\_Kakouros](https://forum.ansible.com/u/Nick_Kakouros)\
**Post date:** [August 27, 2019, 8:21pm UTC](https://forum.ansible.com/t/can-i-run-plays-in-parallel/31145/1 "2019-08-27T20:21:26Z")

</div>

I have 10 files with a play each. In total these plays provision 4 hosts. I have written a function in bash that takes as an argument the host I want to provision and calls ansible with all 10 playbooks and a `-l`(limit) parameter for only the host I provided. I can pass multiple hosts too.

So, when I pass 3 hosts, ansible starts running and it goes through each play one by one. This means that a host may have to unnecessarily wait for previous plays to finish before it is the turn of one of its play.

Is there a way to say to ansible to run all plays in parallel? I could find workaround in bash, but I would like to know if this is possible in ansible.

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [August 27, 2019, 8:26pm UTC](https://forum.ansible.com/t/can-i-run-plays-in-parallel/31145/2 "2019-08-27T20:26:25Z")

</div>

It's not possible in Ansible, so you would need to run multiple ansible-playbook in bash.

---

<div class="post-metadata">

**Author:** ![Jonathan\_Lozada\_De\_L](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jonathan\_Lozada\_De\_L](https://forum.ansible.com/u/Jonathan_Lozada_De_L)\
**Post date:** [August 27, 2019, 8:33pm UTC](https://forum.ansible.com/t/can-i-run-plays-in-parallel/31145/3 "2019-08-27T20:33:34Z")

</div>

you can run multiple plays in one playbook. For example:

hosts: localhost  
roles:

- create\_vm

hosts: vm\_created  
roles:

- configure\_vm

this also assumes you are using add\_host in the first play.

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [August 27, 2019, 8:36pm UTC](https://forum.ansible.com/t/can-i-run-plays-in-parallel/31145/4 "2019-08-27T20:36:57Z")

</div>

Nick is asking for play in parallel, this will still be serial.

---

<div class="post-metadata">

**Author:** ![Jonathan\_Lozada\_De\_L](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jonathan\_Lozada\_De\_L](https://forum.ansible.com/u/Jonathan_Lozada_De_L)\
**Post date:** [August 27, 2019, 8:38pm UTC](https://forum.ansible.com/t/can-i-run-plays-in-parallel/31145/5 "2019-08-27T20:38:05Z")

</div>

Right. Just mentioning an option.
