# Batch/Parallel Playbook Execution

**URL:** <https://forum.ansible.com/t/batch-parallel-playbook-execution/27857>\
**Category:** Ansible Project\
**Created:** [June 23, 2018, 5:22pm UTC](https://forum.ansible.com/t/batch-parallel-playbook-execution/27857 "2018-06-23T17:22:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![muhammed](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@muhammed](https://forum.ansible.com/u/muhammed)\
**Post date:** [June 23, 2018, 5:22pm UTC](https://forum.ansible.com/t/batch-parallel-playbook-execution/27857/1 "2018-06-23T17:22:09Z")

</div>

Hi,

I would like to know if it’s possible to deploy X number of projects at a time.

In my top-level play called _run-deploy.yml,_ the project data is loaded from a json file:

`

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [June 25, 2018, 9:45am UTC](https://forum.ansible.com/t/batch-parallel-playbook-execution/27857/2 "2018-06-25T09:45:09Z")

</div>

There is no top-level parallel execution of playbooks available directly in ansible, but there are lots of other ways to achieve this.

This was discussed a little while back here: [https://github.com/ansible/proposals/issues/31](https://github.com/ansible/proposals/issues/31)

There are some suggestions here: [http://www.slideshare.net/bcoca/more-tips-n-tricks](http://www.slideshare.net/bcoca/more-tips-n-tricks)

In the end I wound up using gnu parallels.

Hope this helps,

Jon

---

<div class="post-metadata">

**Author:** ![muhammed](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@muhammed](https://forum.ansible.com/u/muhammed)\
**Post date:** [June 25, 2018, 7:45pm UTC](https://forum.ansible.com/t/batch-parallel-playbook-execution/27857/3 "2018-06-25T19:45:07Z")

</div>

Thanks Jon,

I’ve made a few changes this morning and seem to have found another way around it using delegation and host vars. It isn’t the most elegant solution, but so far it seems like it could work. Would appreciate any feedback if possible.

_Hosts file:_

`

[websites]  
[site1.example.com](http://site1.example.com)  
site2.example.coms  
[site3.example.com](http://site3.example.com)

`

_group\_vars/websites:_

_`_

ansible\_host: 127.0.0.1

web\_servers:

- [web1.example.com](http://web1.example.com)
- [web2.example.com](http://web2.example.com)

app\_servers:

- [app1.example.com](http://app1.example.com)
- [app2.example.com](http://app2.example.com)

db\_server: [db1.example.com](http://db1.example.com)

`

_run\_deploy.yml:_

_`_
