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.

I am kinda stuck with a problem I am trying to wrap my head around for days now.

Here is what I am doing:

  1. By using Veewee, I am creating a VirtualBox image and then I create a Vagrant box from it. See here, here
  2. Finally I run puppet from Vagrant to install RabbitMQ, see here.

Veewee, Vagrant and VirtualBox all run on MacOS X 10.7.4. The vagrant box itself is CentOS 6.2.

This worked fine for quite some time until I was recreating the VirtualBox image a couple of days ago. During installation of the rabbitmq-plugins during my puppet run I now get the following error:

/Stage[main]/Rabbitmq/Exec[rabbitmq-plugins]/returns: erlexec: HOME must be set

My RabbitMQ puppet configuration can be found on my GitHub repo for that project, but here is the most important part:

$version = "2.8.7"
$url     = "http://www.rabbitmq.com/releases/rabbitmq-server/v${version}/rabbitmq-server-${version}-1.noarch.rpm"

package{"erlang":
    ensure => "present",
}

package{"rabbitmq-server":
    provider => "rpm",
    source   => $url,
    require  => Package["erlang"]
}

exec{"rabbitmq-plugins":
    path    => "/usr/bin:/usr/sbin:/bin",
    command => "rabbitmq-plugins enable rabbitmq_management",
    require => Package["rabbitmq-server"]
}

My additional repositories, e.g. epel, are defined in veewees postinstall.sh right at the top of the file.

Finally, this is what I get when I do '/etc/init.d/rabbitmq-server status'

[{pid,2834},
{running_applications,[{rabbit,"RabbitMQ","2.8.7"},
                    {ssl,"Erlang/OTP SSL application","4.1.6"},
                    {public_key,"Public key infrastructure","0.13"},
                    {crypto,"CRYPTO version 2","2.0.4"},
                    {mnesia,"MNESIA  CXC 138 12","4.5"},
                    {os_mon,"CPO  CXC 138 46","2.2.7"},
                    {sasl,"SASL  CXC 138 11","2.1.10"},
                    {stdlib,"ERTS  CXC 138 10","1.17.5"},
                    {kernel,"ERTS  CXC 138 10","2.14.5"}]},
{os,{unix,linux}},
{erlang_version,"Erlang R14B04 (erts-5.8.5) [source] [64-bit] [rq:1] [async-threads:30] [kernel-poll:true]\n"},
{memory,[{total,24993120},
      {processes,10328496},
      {processes_used,10321296},
      {system,14664624},
      {atom,1175905},
      {atom_used,1143841},
      {binary,17192},
      {code,11416020},
      {ets,766168}]},
{vm_memory_high_watermark,0.4},
{vm_memory_limit,205851852},
{disk_free_limit,1000000000},
{disk_free,7089795072},
{file_descriptors,[{total_limit,924},
                {total_used,4},
                {sockets_limit,829},
                {sockets_used,2}]},
{processes,[{limit,1048576},{used,131}]},
{run_queue,0},
{uptime,6}]

Sources in the web suggest, that I have to set HOME. Of course I was logging into the box if HOME was set, for user vagrant it was '/home/vagrant' and for root it was 'root'.

As always, any hints/ideas/suggestions/assumptions are more than welcome.

Thanks a lot!

Cheers, Tobi

share|improve this question
    
Are you actually solving a problem? –  Joel E Salas Oct 4 '12 at 20:51
    
Sure, my goal is to create two vagrant boxes, one with a sensu client and one with a sensu server. Since I am new to puppet, am experimenting a lot, that requires me to have vagrant to be able to destroy a box and build it up again. It already worked fine. Having only the ISO image and a few files on GitHub, I was able to do so, but not any more. –  Tobias Oct 4 '12 at 21:04
    
And what is the problem exactly? You have a puppet file to install rabbitmq, and it seems to run just fine ? –  hayalci Oct 4 '12 at 22:24
    
Actually, not quite ... It runs fine until '/Stage[main]/Rabbitmq/Exec[rabbitmq-plugins]/returns: erlexec: HOME must be set', see my post, and then I get '/Stage[main]/Rabbitmq/Service[rabbitmq-server]: Dependency Exec[rabbitmq-plugins] has failures: true'. All other resources that would be applied afterwards fail because of this failed dependency. –  Tobias Oct 5 '12 at 4:54
add comment

1 Answer 1

up vote 10 down vote accepted

I ran into this same issue after upgrading to Puppet 3.0.

From the release notes I eventually found this:

Due to misleading values, the HOME and USER environment variables are now unset when running commands.

The solution that worked for me was adding environment => "HOME=/root" to the Exec resource:

exec{"rabbitmq-plugins":
    path        => "/usr/bin:/usr/sbin:/bin",
    environment => "HOME=/root",
    command     => "rabbitmq-plugins enable rabbitmq_management",
    require     => Package["rabbitmq-server"]
}

Hope this helps!

share|improve this answer
    
Thanks a lot, this helped. My mistake was, that I have set the environment variable in a separate exec-resource, assuming this will apply for all other exec-resources as well. Obviously it doesn't. –  Tobias Oct 6 '12 at 8:40
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.