Reputation: 2442
I'm using puppet with Vagrant but have a few issues around using rbenv to setup the Ruby installs.
Ruby is installing fine (I'm using the plugin: https://forge.puppetlabs.com/jdowning/rbenv to install ruby + gems as so:
rbenv::plugin { 'sstephenson/ruby-build': } ->
rbenv::build { '1.9.3-p392': global => true } ->
rbenv::gem { 'bundler': ruby_version => '1.9.3-p392' } ->
However after running this, Puppet cannot find the bundler command under rbenvs shim folder. I can see rbenv rehash events and examining the manifest of the plugin shows that it should rehash the binaries after running and gem installs etc.
If I ssh to the machine, a "which bundler" finds the path to the binary. Likewise, re-running the puppet script works correctly and installs everything fine.
At the moment I'm using the following command:
exec { "bundle install":
user => $app_user,
group => $app_group,
command => "bundle install",
path => [ '/bin/', '/sbin/', '/usr/bin/', '/usr/sbin/', "/home/${app_user}/.rbenv/bin/", "/home/${app_user}/.rbenv/shims/" ],
cwd => $app_root,
} ->
The path is overkill I know.
Any ideas on what I could try next? I'm out of ideas.
Upvotes: 4
Views: 959
Reputation: 8223
It's important to make sure that all the gem setup is complete before you try to exec bundler, e.g.
exec { "bundle install": require => Rbenv::Gem["..."], ... }
Otherwise, it's possible that the rehash resource gets evaluated after your exec.
Upvotes: 0