Learn about Cloud Tech by Automating Your Home Setup with Puppet or Ansible

Learn about Cloud Tech by Automating Your Home Setup with Puppet or Ansible
Photo by john foust / Unsplash

You can learn a lot about cloud automation by doing some home automation. This is especially the case if you use linux based machines as your main computers at home. I highly recommend using any of the free distributions out there as they are free and a standard component for cloud computing software.

If you're a gamer and a little afraid of taking the plunge into using a unix machine as your primary OS, you can definitely run them in a VM or have a separate boot partition for them to switch between the different OS's Personally, I use Ubuntu as my main operating system and spin up a Windows VM via Virtualbox whenever I have a need to run software that I'd prefer to run in a VM.

If you are able to take the plunge into using a linux distribution as your main OS, a wealth of new opporunities open – software installation and configuration can be completely automated. If you've re-installed your operating system or migrated to a new machine before, the time it takes to have your new machine setup used to take hours and pray that you've not forgotten some hidden configuration change that you did long ago to make something work!

Enter automated configuration and software package management tooling

Tools like puppet or ansible do exactly just that and they're a world of wonder when it comes to turning installation steps that you've taken in the past into repeatable installation scripts that you can mix and match to get your machine(s) to the desired state.

At a high level, your machines can be identified by a variety of attributes – hostname, OS, domain name, ip address and much, much more. By selecting for these attributes, scripts can be run to install specific software packages and configuration files on the machine. For example if you have your home desktop, a media server and perhaps a few raspberry pi's around the house, the state of these machines can be managed by puppet or ansible as mentioned above.

Should you one day need to configure more machines, or reinstall your OS, the same scripts can be used again setup the machine with ease.

Make a habit of scripting your installation process

A common problem that people run into is doing things by hand once and forgetting about it down the road. The challenge about software packages is that there are so many of them – each with their own set of custom settings and quirks that you'll occasionaly need to work around. Also there is the challenge of keeping your settings up-to-date when things do change and that can also be quite the hassle too!

  • Do you have multiple network cards and need to setup certain routing routes and custom firewalls?
  • Did you remember to change the listening ip address of your freshly (re)installed database to not limit it to localhost?
  • Wouldn't it be nice to template some of your nginx routing rules so you don't have to modify multiple files everytime when updating a service setting?

The points above are examples of some of the cases where automated setup and configuration management is immensely helpful to reduce the drudgery of maintaing your machines at home.

How managing your machines at home tie into understanding cloud management

Once you start to understand the benefits of managing your computers at home using configuration management software, you'll start to realize that managing cloud resources is a story that rhymes. You'll have several machines like an application server, database server, routing server, each of which will have their own set of installed software and configuration. You'll want to avoid the drudgery of modifying multiple configuration files when making updates or adding new services to your cloud infrasturcture. If you want to replicate your setup so to have a development and production environment, you'll definitely want to automate the steps to manage separate but similar setups to do development and testing.