Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
        /Library/LaunchDaemons/homebrew.mxcl.rabbitmq.plist'
    Debug: Executing '/usr/bin/plutil -convert xml1 -o /dev/stdout
        /var/db/launchd.db/com.apple.launchd/overrides.plist'
    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
show 1 more comment

1 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
add comment

Your Answer

 
discard

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.