Why my puppet can not handle bundle exec?
puppet
Solution
The real error is found by adding output => true:
couldn't find HOME environment -- expanding `~'
And this is a know issue in Puppet3, see
https://groups.google.com/forum/#!topic/puppet-users/5sk9mJqe4Z0
So add HOME env solves the problem:
environment => "HOME=/root"
Problem
My install file is like this: ``` ... cd /home/work/package/dea_ng ... bundle install export PATH=$PATH:/usr/local/go/bin bundle exec rake dir_server:install ``` I'm pretty sure that the last command can run successfully on my client machine, but puppet keep reporting " returned 1 instead of one of [0]" error. So, here is the install manifest: ``` class dea_ng::install { exec { "/bin/bash /home/work/install/dea_ng_install.sh": path=>'/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin', cwd =>'/home/work/install', logoutput => false, require =>Class["dea_ng::dea_ngfile"], before => Class["dea_ng::service"], } } ``` The problem also happens to my start command which also use bundle exec: after puppet finished dea_ng::install and run dea_ng::service, the command below did not work unless I execute it manually on the client machine. ``` bundle exec rake dir_server:run[config/dea.yml] & ``` I'm really confused about this, it seems like puppet can not handle bundle exec well in my case. Did I missed some env configuration here? The output of --debug seems no help: ``` Debug: Executing '/bin/bash /home/work/install/dea_ng_install.sh' Error: /bin/bash /home/work/install/dea_ng_install.sh returned 1 instead of one of [0] Error: /Stage[main]/Dea_ng::Install/Exec[/bin/bash /home/work/install/dea_ng_install.sh]/returns: change from notrun to 0 failed: /bin/bash /home/work/install/dea_ng_install.sh returned 1 instead of one of [0] ``` And if I remove the bundle exec line, the shell will success.