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"

    ensure => "present",

    provider => "rpm",
    source   => $url,
    require  => Package["erlang"]

    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'

                    {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"}]},
{erlang_version,"Erlang R14B04 (erts-5.8.5) [source] [64-bit] [rq:1] [async-threads:30] [kernel-poll:true]\n"},

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

  • 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

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:

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

Hope this helps!

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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