Playbook synchronization

36 views
Skip to first unread message

Ilya Averyanov

unread,
Mar 17, 2014, 3:29:26 AM3/17/14
to ansible...@googlegroups.com
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?

Michael DeHaan

unread,
Mar 17, 2014, 9:52:29 AM3/17/14
to ansible...@googlegroups.com
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.




--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e459ff87-487c-41e1-b5f7-15b1f6b3efa1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages