trevmex's tumblings

JavaScripter, Rubyist, Functional Programmer, Agile Practitioner.

Bootstrapping Puppet on Mac OS X

So, I have been trying to figure out how to get puppet up and running on Mac OS X. I thought it would be pretty straightforward, but I was having a hard time finding puppet n00b info for OS X, and @nigelkersten seems to be the only one in the universe that is doing this stuff.

Anyway, I was tutting it up like a good n00b, and I got to this:

puppetmasterd --mkusers

And (OH NOES!) the silly ids attacked my face off! So I sit there banging my head against the wall for a while. I ask my awesome coworker and he says, “Oh yeah, you have to run it as root on OS X.” So being a n00b, I say, “What! But I read a post that said otherwise. I think I’ll continue cheese-grating my head for a while.” (delicious!)

(Time passes)

While searching through the bog pits of the Internets, I fond a gem of an email thread all about puppet.conf, which blew me away. I created the files that the email talked about, booted up the server, booted up my client (which is the same as the server for testing purposes) and BLAMMO! Puppet is fully armed and operational.

I wrote a little postinstall script to setup the files needed to have the server run.

Now what you all have been waiting for, this is exactly what I did to get it all working:

  1. Download facter
  2. Download puppet
  3. Build and install the facter package:
    tar zxvf facter-latest.tgz
    cd facter-1.5.7 # This will be different in future versions
    /usr/bin/ruby ./conf/osx/createpackage.sh # Creates the package in this directory, now you can use it for other servers
    open facter-1.5.7.pkg # This will be different in future versions
  4. Build and install the puppet package:
    tar zxvf puppet-latest.tgz
    cd puppet-2.6.0 # This will be different in future versions
    /usr/bin/ruby ./conf/osx/createpackage.sh # Creates the package in this directory, now you can use it for other servers
    open puppet-2.6.0.pkg # This will be different in future versions
  5. Run my postinstall script:
    sudo /usr/bin/ruby -e "$(curl -fsS https://raw.github.com/gist/6adfc4d7dbfe71873186/puppet-osx-postinstall.rb)"
  6. Spin up the puppet master (locally):
    sudo /usr/sbin/puppetmasterd --no-daemonize --verbose --debug
  7. Run the puppet agent (in a new Terminal window) as a test:
    sudo puppetd --server `hostname` --waitforcert 60 --test

You should see the following:

info: Caching catalog for localhost
info: Applying configuration version '123467890'
notice: Finished catalog run in 0.02 seconds

That means it worked! Now you can get to work adding REAL puppet configurations to your /etc/puppet/manifests/site.pp file.

I hope this helps some other puppet n00bs out there. Until next hurdle, see you!