# Playbook synchronization

**URL:** <https://forum.ansible.com/t/playbook-synchronization/14792>\
**Category:** Ansible Project\
**Created:** [March 17, 2014, 7:29am UTC](https://forum.ansible.com/t/playbook-synchronization/14792 "2014-03-17T07:29:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ilya\_Averyanov](https://avatars.discourse-cdn.com/v4/letter/i/47e85d/32.png) [@Ilya\_Averyanov](https://forum.ansible.com/u/Ilya_Averyanov)\
**Post date:** [March 17, 2014, 7:29am UTC](https://forum.ansible.com/t/playbook-synchronization/14792/1 "2014-03-17T07:29:26Z")

</div>

Hello,

I have some problems with organising my application deploy setup: I have pretty different playbooks for different groups of hosts, but these playbooks have a few common roles which execution should be synchronised through servers from all groups (db update, restart with new configs etc). This is required because it’s important that different parts of application work with the same data; also it’s important for all users to see any changes at once.

I see that servers from different playbooks are updated consequently; even if they could be updated simultaneously, I can’t find any tool for synchronisation.

Example:

palybook1:

- hosts: group1  
roles:
- some\_stuff
- migrate\_data
- some\_more\_stuff
- switch\_to\_new

playbook2:

- hosts: group2  
roles:
- some\_other\_stuff
- migrate\_data
- some\_more\_other\_stuff
- switch\_to\_new

Roles migrate\_data and switch\_to\_new should be executed simultaneously for the whole union of group1 and group2 servers.

Is there a natural, idiomatic way in which this problem could be solved?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [March 17, 2014, 1:52pm UTC](https://forum.ansible.com/t/playbook-synchronization/14792/2 "2014-03-17T13:52:29Z")

</div>

What you should do is have one playbook with three included play files in it.

Apply configuration to play1 and play2, then against “all” hosts you can apply the “switch\_to\_new” roles.

Though it does sound like you might want to investigate load balancers.
