Upgrade to Pro — share decks privately, control downloads, hide ads and more …

An Introduction to Server Automation with Puppet

An Introduction to Server Automation with Puppet

A look at getting started using puppet, for the purpose of installing a server ready for web application deployment


Jeremy Olliver

January 13, 2012


  1. Introduction to Server Automation with Puppet Jeremy Olliver @static_storm

  2. Why automate? • A good developer is a lazy developer

    • Saves time • Easier to get right/consistent • Otherwise you’ll have to write documentation
  3. Popular tools for Automating • Puppet • Chef • O/S

    package provider specific (Kick start) • others
  4. Chef • DSL written in pure ruby • Highly customisable

    • Uses a large amount of boilerplate code for configuration • Steep learning curve
  5. Puppet • Uses a configuration DSL (not actual coding language)

    • simple to configure • Large community • easy installation
  6. Puppet vs. Chef Example • Both use an ERB template

    • Chef declares much more meta-data • Puppet example is simpler and easier to configure
  7. Use the right tool for the job • Both have

    their advantages & downsides • Investigate both and see if they fit your requirements • we’ll be talking about using puppet
  8. Puppet Architecture • Server-client • Puppet Master runs a ruby

    application under ssl • puppet client connects to master & pulls down config • clients generate a cert to be authenticated by the puppet master
  9. Setting up Puppet • Install as either a ruby gem,

    or via distribution package (e.g. apt, yum) • server: apt-get install puppetmasterd # /etc/puppet/puppet.conf service puppetmaster start
  10. Puppet client apt-get install puppet # Edit /etc/hosts puppet

    # Edit /etc/hostname app1.abletech.co.nz app1 hostname --fqdn puppetd --test # or: service puppetd start
  11. Authenticating Puppet • server: • client: puppetca --list > app1.abletech.co.nz

    puppetca --sign app1.abletech.co.nz puppetd --test
  12. Configuring Server Script Examples...

  13. Benefits • Have a new server configured & customised in

    half an hour • uniform server conventions/layout • self-documenting & repeatable