5. • My background
• Learning Puppet and initial challenges
• Our current use of Puppet
• Why Puppet for small businesses with a
handful of servers?
6. 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
9. Initial setup would be documented
but configuration would drift over
time as we updated, installed and
16. “By starting small and getting good at
automating one discrete task, you can
establish a foundation for bigger
17. Ideas for small tasks
• cron jobs
• ssh keys
• specific config files -
for example a
• packages or settings
you configure on all
servers as standard
29. • 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
32. A common.yaml
common to all
comment: "Rachel Andrew"
comment: "Drew McLellan"
specific to one
server is held in
eg: vhosts and
34. The hiera.yaml
35. hiera_hash gives
an array of users,
the node specific
I can use that in
$sites = hiera_hash('apache_vhosts')
$db = hiera_hash('mysql_db')
36. “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”
41. 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
43. • 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.
44. Start small with Puppet, but be
aware of non-obvious problems
that Puppet can help solve.
45. I use Vagrant and Puppet to test
and build the site packages locally.
48. Small companies
• often don’t need hugely redundant
• having sites offline for a few hours not critical
• … as long as everything can be restored.
49. Before Puppet
• 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.
50. With Puppet
• 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
51. A good test - can you restore any
of your servers into a local VM?