Stand Alone Puppet

While Puppet can be used to manage large, complex environments it’s also a useful tool at the lower end of the spectrum. Using just the puppet executable and a small inline class or two you can write very useful manifests in only a handful of lines.

class build_host {
  package { 'build-essential': ensure => installed }
  package { 'subversion':      ensure => installed }

  file { "/home/dwilson/repos/":
    ensure => directory,
    owner  => dwilson,
    group  => dwilson,
  }
}

node default {
  include build_host
}

To invoke the class you just run puppet -v build-host.pp. It’s also worth pointing out the node name of default. This saves you manually changing the manifest whenever you move to another machine. While it wouldn’t be hard to replace the above example with a shell script, by using puppet you can easily access the built-in abstractions (which package manager to use, how should you add users) and remove a lot of scaffolding code. And then when you’re done you can promote the class to your managed infrastructure.

I’ve used this to bootstrap provisioning servers (why should the provisioning host be the only machine that wasn’t provisioned?), test small but annoying new classes on scratch servers and I’m currently working on integrating it with a small subversion backup testing project in my spare time at work (so very slowly).