O'Reilly logo

Puppet 3 Cookbook by John Arundel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Bootstrapping Puppet with Rake

To make a newly provisioned machine part of our Puppet infrastructure, we just need to run a few commands on it, so let's make this process even easier by adding a new bootstrap task to the Rakefile.

Getting ready...

To get ready for the recipe, do the following:

  1. Add the following line to the top of your Rakefile:
    REPO = 'git@github.com:bitfield/cookbook.git'
  2. Add the following task anywhere in the Rakefile:
    desc "Bootstrap Puppet on ENV['CLIENT'] with hostname ENV['HOSTNAME']" task :bootstrap do client = ENV['CLIENT'] hostname = ENV['HOSTNAME'] || client commands = <<BOOTSTRAP sudo hostname #{hostname} && \ sudo su - c 'echo #{hostname} >/etc/hostname' && \ wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required