Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a production environment configured with Puppet, and want to be able to set up a similar environment on our development machines: a mix of Red Hats, Ubuntus and OSX. As might be expected, OSX is the odd man out here, and sadly, I'm having a lot of trouble with getting this to work.

My first attempt was using macports, using the following declaration:

package { 'rabbitmq-server':
    ensure   => installed,
    provider => macports,

but this, sadly, generates the following error:

Error: /Stage[main]/Rabbitmq/Package[rabbitmq-server]: Could not evaluate: Execution of '/opt/local/bin/port -q installed rabbitmq-server' returned 1: usage: cut -b list [-n] [file ...]
       cut -c list [file ...]
       cut -f list [-s] [-d delim] [file ...]
    while executing
"exec dscl -q . -read /Users/$env(SUDO_USER) NFSHomeDirectory | cut -d ' ' -f 2"
    (procedure "mportinit" line 95)
    invoked from within
"mportinit ui_options global_options global_variations"

Next up, I figured I'd give homebrew a try. There is no package provider available by default, but puppet-homebrew seemed promising. Here, I got much farther, and actually managed to get the install to work.

package { 'rabbitmq':
    ensure   => installed,
    provider => brew,
file { "plist":
    path   => "/Library/LaunchDaemons/homebrew.mxcl.rabbitmq.plist",
    source => "/usr/local/opt/rabbitmq/homebrew.mxcl.rabbitmq.plist",
    ensure => present,
    owner  => root,
    group  => wheel,
    mode   => 0644,
service { "homebrew.mxcl.rabbitmq":
    enable      => true,
    ensure      => running,
    provider    => "launchd",
    require     => [ File["/Library/LaunchDaemons/homebrew.mxcl.rabbitmq.plist"] ],

Here, I don't get any error. But RabbitMQ doesn't start either (as it does if I do a manual load with launchctl)

    [... snip ...]
    Debug: Executing '/bin/launchctl list'
    Debug: Executing '/usr/bin/plutil -convert xml1 -o /dev/stdout
    Debug: Executing '/usr/bin/plutil -convert xml1 -o /dev/stdout
    Debug: /Schedule[weekly]: Skipping device resources because running on a host
    Debug: /Schedule[puppet]: Skipping device resources because running on a host
    Debug: Finishing transaction 2248294820
    Debug: Storing state
    Debug: Stored state in 0.01 seconds
    Finished catalog run in 25.90 seconds

What am I doing wrong?

Edit: For the record, we're now doing this with Vagrant VMs instead on our OSX machines, but the native solution would still be preferred.

share|improve this question
What version of puppet are you running? Are you trying the above manifests with puppet apply manifest.pp? – chutz Dec 10 '12 at 23:59
The debug does not seems to contain any 'actual' error. Can you check in /private/var/log/system.log if there are any related entries? – John Siu Dec 11 '12 at 18:36
@chutz: Running sudo puppet apply manifest.pp on Puppet 3.0.1, Facter 1.6.16 @JohnSiu: Nothing there either, sadly. – Joel Westberg Dec 11 '12 at 22:18
I don't think your are going wrong in any way. However , I think you must check the programming approach once again. – Toby Apr 25 '13 at 5:20
Do you know if puppet is loading the launchd plist? If not, you'll need to wait til reboot, or force a launchctl load plist step after install. Make sure the plist has the run on load flag set in it. Can you post the plist and output of launchctl list with the service name. – Alex Jul 21 '13 at 6:42

Unfortunately, configuration management tools don't really work well for desktop machines. It is much better to use a tool like Vagrant (as you have).

Vagrant is an open-source virtualization software that allows you to replicate environments via hypervisors. On my Mac, I use it with Oracle's VirtualBox (mostly for Chef testing). VirtualBox is also free. The original intent of Vagrant was to allow developers to have consistent environments to work in (ie: what you were looking for but not how you wanted it to work). Vagrant can be combined with Puppet, check out these examples.

share|improve this answer

A sort of brute force approach:

class rabbitmqosx {    
    exec { "rabbitmqosx":
           command =>  "/path/to/rabbitmq",
           unless => [ 
                       "/bin/ps |grep -c rabbitmq" 

node fancymac { include "rabbitmqosx }
share|improve this answer

Not sure if this is still an issue but it looks like this was a bug with the launchd provider fixed in 3.1.0. Bug:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.