ANSIBLE
Automatically provision devices with Ansible
Embrace laziness with Matthew Holder and auto-configure your systems by installing packages and adding files with Ansible.
OUR EXPERT
Matt Holder has worked in IT support for over a decade, and always tries to utilise Linux alongside other installed systems.
C loud computing is a term that means a number of things. Software as a Service (SaaS) is one such example of what can be hosted in the cloud. Platform as a Service (PaaS) is the next step down the cloud computing ladder and allows a developer to create their service on an operating system that is managed by the supplier, so they don’t need to worry about it. A third example is Infrastructure as a Service (IaaS), which essentially provides the user with a rented hardware platform. The hardware is maintained by the supplier, while anything softwarerelated is maintained and managed by the user.
Given the services on offer, such as the ability to run a web app directly on a cloud computing provider, some of the skill of maintaining the web server, MySQL database and so on can be abstracted away and is paid for within the fee charged. Let’s take the example of a popular blog website, which is regularly visited by millions of people. The blogging solution may well be written in the PHP programming language, data stored in a MySQL database, while file storage is on the hard drive of the virtual host. This could all be manually hosted using IaaS or by a provider offering the blogging software as SaaS. What happens, though, if our SaaS provider can’t provide the required uptime when a new article is posted?
This is where some of the extra tools on offer can help us. It would be entirely possible to split out this website into multiple components, so that redundancy is provided. Content can be copied to multiple web Managed Nodes are listed and any defined devices have been pinged and reported on. servers or databases, and a load balancer used to determine which web server should be visited by that user, storage can be replicated across multiple nodes so that all uploaded files can remain accessible, and any static elements, such as images, CSS and JavaScript, can be uploaded to a content delivery network (CDN).
It is amazing that all these tools are available, but what has just been described would take some setting up and would have a lot of moving parts. What if something catastrophic happened and everything had to be built again from scratch? How long would it take to spin up again and then restore the data from backups? After all, we all document setups, perform regular backups and, most importantly, test our backups, don’t we? This is where the term ‘infrastructure as code’ becomes relevant. What this means is that our software and virtual hardware should be able to be configured using a descriptive method, which can be run again and again. Using this sort of methodology means that our hardware and software platforms become completely utilitarian and can be replaced quickly and as is needed – another saying is often heard: ‘cattle, not pets’. Descriptive configuration code can then be stored in a version control system to allow easy rollback should changes be made and our configurations become broken.