I have the requirement to perform rolling deploys to groups of servers at a time, e.g. the first set of servers - app1_server_1, app2_server_1, app3_server1 - first, then the second set - app1_server2, app2_server2, app3_server2 - then the third set, app1_server3, app2_server3, app3_server3, etc.
Hi Guy,
First you need a way to refer to your servers in the required release order. Easy way is to just have them as a group in your host file such as:
[servers]
server1
server2
server3
…
serverN
Then in your rolling deploy playbook, you refer to this group as hosts, and use serial=1 if you would like Ansible to finish all apps in one server before moving on to the next one.
To force the app order, you can create task lists for each deploy, and then include them in order, such as: