No chapter on routine maintenance would be complete without a look at rolling updates. So far in this book, we have kept our examples simple with one or two hosts, and have worked on the basis that all examples can be scaled up to manage hundreds, if not thousands, of servers using the same roles and playbooks.
This, by and large, holds true—however, there are certain special cases where perhaps we need to look a little deeper at the operation of Ansible. Let's build up a hypothetical example, where we have four web application servers behind a load balancer. A new release of the web application code needs to be deployed, and the deployment process requires multiple steps (thus, multiple Ansible tasks). In our simple example, the deployment process will be as follows:
- Deploy the web application code to the server.
- Restart the web server...