KVM and Puppet is awesome
Building your network never has been easier. These days DevOps are everywhere, and with tools like KVM, and Puppet freely available, you can build your local network by only focusing on what each system should do for you.
Let us wind back time a bit, and consider it was the year 2005. Back then when you wanted to setup a network for your office, you would face a truly epic task: that of manually configuring servers. If you where lucky, only a few, on a bad day it might have been dozens.
Back then this meant hideous amounts of planning, documentation, and preparation of configuration files, and of course system preparation, including system installation, and basic configuration to get started.
This meant tons of identical tasks to fulfill, and every single task had to be done by hand. I’ve been there, and you probably have faint memories of these days, too.
Luckily for us, there is an application for that: Puppet. Puppet is IT automation software that helps system administrators manage infrastructure throughout its life-cycle, from provisioning and configuration to patch management and compliance.
Based on Ubuntu 12.04 Server, we will create a simple server host with KVM enabled.
… a KVM server
We are going to build our packages by bootstrapping Ubuntu with the original packages. While bandwidth may be cheap, we can spare us the time of downloading packages twice by using an apt package caching proxy.
apt-cacher-ng by issuing this command:
Once installed edit
/etc/apt-cacher-ng/acng.conf and replace the
Port:9999, and fire up our local
repository cache by executing
… a Puppet master
Now, we generate a MAC address by executing
Next we create an image using our new MAC address for the Puppet master by issuing the following parameters:
… a KVM / puppet client
The default host will contain the only the Puppet agent. Again, a new MAC address is created using the command from earlier. Thus we will modify the command as follows:
If you have suggestions for additional topics, send a tweet to @marenkay.
Since we now have a Puppet master and a first client running, we will learn how easy we can schedule and deploy system changes to both our client and our server. The good news is: in Puppet, the master server can also be a client. The following list is what came to my mind while writing this, so it surely is not complete.
- tracking Puppet configuration changes,
- creating clients with Puppet pre-configured,
- administering Puppet with Puppet Dashboard or The Foreman.
There are quite a few interesting things which we can achieve with Puppet, and I’ll be covering these step by step.
All code snippets in this post are made available to use under the MIT Licence.