alup/puppet-rbenv — pull request #33 by jasongill (2012-09-16 03:24:03+00:00)
Title: Two fixes to help when installing to non-standard paths

* The dependency chain in manifests/install.pp previously allowed the .bashrc and .rbenvrc files to be created even if installation failed. This patch fixes the following situation:
````
notice: /Stage[main]/Myrubyapp/Rbenv::Install[apps]/File[rbenv::rbenvrc apps]/ensure: defined content as '{md5}3c0d7cc5a836d399549a433fea1f15b3'
err: /Stage[main]/Myrubyapp/Rbenv::Install[apps]/Exec[rbenv::checkout apps]/returns: change from notrun to 0 failed...(error continues)
````
which leads to:
````
su - apps
-bash: rbenv: command not found
````

* Added cwd to execs to prevent git from dying with return code 128 when attempting to change back to a directory that the user does not have permission to access. This patch fixes the following situation:
````
err: /Stage[main]/Myrubyapp/Rbenv::Install[apps]/Exec[rbenv::checkout apps]/returns: change from notrun to 0 failed: git clone git://github.com/sstephenson/rbenv.git /opt/apps/.rbenv returned 128 instead of one of [0] at /etc/puppetlabs/puppet/modules/rbenv/manifests/install.pp:27
notice: /Stage[main]/Myrubyapp/Rbenv::Install[apps]/Exec[rbenv::checkout apps]/returns: fatal: Could not change back to '/root': Permission denied
````