• My background
• Learning Puppet and initial challenges
• Our current use of Puppet
• Why Puppet for small businesses with a
handful of servers?
This is my job.
• tech support person
• filler in of baffling
forms from the
• PHP developer
• front-end web
• sales person
• public speaker
• … ops person.
• Infrastructure consisted of a bunch of VPS
boxes hosted at Memset
• Configured at different times
• Some set up by me, some by Drew
• Neither of us understood the setups done by
• No real handle on what was installed where
Initial setup would be documented
but configuration would drift over
time as we updated, installed and
“By starting small and getting good at
automating one discrete task, you can
establish a foundation for bigger
Ideas for small tasks
• cron jobs
• ssh keys
• specific config files -
for example a
• packages or settings
you configure on all
servers as standard
• A Puppet Master, PuppetDB is on the same
• Three webservers
• The “demo server”, also a webserver but of
• PuppetBoard and Scout to see what is
happening in Puppet and for monitoring
• Puppetlabs Apache, MySQL
• modules/hosting = a module I’ve written than
wraps up standard things used on webservers
• make use of hiera for site, database and user
Discovering Hiera made Puppet
make sense to me.
common to all
comment: "Rachel Andrew"
comment: "Drew McLellan"
specific to one
server is held in
eg: vhosts and
an array of users,
the node specific
I can use that in
$sites = hiera_hash('apache_vhosts')
$db = hiera_hash('mysql_db')
“When you come up with a solution
using create_resources(), I challenge
you to draw up another solution using
Puppet code in a Puppet manifest”
Standard CMS demos allow
everyone access to one install
which is “refreshed” periodically.
We wanted to give everyone a clean
demo all of their own.
Hiera can have
Hiera can use
json as well as
• create a home directory
• grab the site files tarball and untar into the home directory
• get the relevant SQL dump
• grab the config file and replace out db details
• create a database using the import file
• create a vhost
• execute a script to notify Air Traffic Control the site is
• json Hiera backend is the source of truth for
Puppet as to what sites should be running
• could deploy to multiple servers by writing
multiple json files one for each node
• can deploy different versions of Perch - for
example to allow someone to try out a beta
• currently deploying and tearing down 50 or 60
sites per day. It just works.
Start small with Puppet, but be
aware of non-obvious problems
that Puppet can help solve.
I use Vagrant and Puppet to test
and build the site packages locally.
Why should small business and
small infrastructures consider
• often don’t need hugely redundant
• having sites offline for a few hours not critical
• … as long as everything can be restored.
• Rebuilding our infrastructure would have
involved us “trying to remember” what went
• Just getting servers reinstalled would have
taken a long time.
• Then we would have had to reconfigure every
site, every SSH key, one at a time.
• Configuration for each server is held in code,
and in an external git repo
• Checkout the modules onto a new Puppet
• Spin up new servers and run Puppet which
would create all resources - sites, keys etc.
• We could then import any data such as MySQL
A good test - can you restore any
of your servers into a local VM?