Overview
Puppet is the not quite so new automated server provisioning hotness. It allows you to provision and manage servers automatically from one Puppet Master Server. It is a great solution for quickly bringing up new VPS instances. Here is a quick walkthrough on how to get started on Ubuntu 10.04 LTS
Assumptions
I’m setting this up on two clean installs of Ubuntu 10.04 LTS Server Edition. If you are using other Linux flavours things should work but your experience may vary.
Setup
To help learn Puppet I used two Ubuntu server instances in VirtualBox. If you choose to use VirtualBox in the network settings for the virtual machine choose Bridged Adapter to allow a network IP address to be assigned.
Next I installed the two servers from the .iso and gave the Puppet Master the hostname of puppetmaster and the Puppet Client the name of puppetclient. The rest of the install is standard, selecting no automatic updates, and installing no additional software.
Installing Puppet
Once you’ve installed the servers we can get going with the interesting stuff - installing and configuring Puppet. There is a package available for Puppet in aptitude but I found I had issues with this so instead I recommend that you install it via RubyGems so let’s get that installed
First install packages required by Puppet via aptitude
1 2 | |
Now we can install RubyGems
1 2 3 4 5 6 7 | |
And finally Puppet
1
| |
All done!
Configuring Puppet
I’m assuming you have completed the installation of Puppet on both the puppet master and client servers. I’m working locally so I need to explicity set the ip addresses of my Puppet Master and client in my /etc/hosts file. To find out the internally assigned ip address run
1
| |
You want the entry that say inet addr: - it should be something like 192.168.3.162
Then you need to update the /etc/hosts file on each machine with each machine’s ip address
1 2 | |
Now on the Puppet Master you need to set up the puppet configuration in /etc. John Arundel of Bitfield Consulting has created a handy tarball that you can use as a template. Let’s get it
1 2 3 | |
This provides a basic stucture for Puppet configuration. We’ll come onto writing manifests in a later post. Now we can start the Puppet daemon, making the relevant system users in the process
1
| |
If you see it start then great. I encountered a bug here that meant the Puppet Master Deamon failed to start. The issue here is that file ownership isn’t set correctly I fixed this with
1
| |
Once you are sure everything is ok you can daemonize Puppet with
1
| |
Finally we can run a local test to make sure that everything is running as expected
1
| |
You should see something like
1 2 3 | |
Next we’ll look at connecting the client to the Puppet Master, creating manifests before moving on to managing users. Stay tuned!