Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for non home-directory installs #76

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions manifests/install.pp
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
define rbenv::install(
$user = $title,
$group = $user,
$home = '',
$root = '',
$rc = '.profile'
$user = $title,
$group = $user,
$home = '',
$root = '',
$rc = ".profile",
$profile_d = '',
) {

# Workaround http://projects.puppetlabs.com/issues/9848
Expand All @@ -21,13 +22,24 @@
command => "git clone https://github.com/sstephenson/rbenv.git ${root_path}",
user => $user,
group => $group,
creates => $root_path,
creates => "$root_path/.git",
path => ['/bin', '/usr/bin', '/usr/sbin'],
timeout => 100,
cwd => $home_path,
require => Package['git'],
}

if $profile_d {
file { "rbenv::rbenvrc ${profile_d}":
path => "${profile_d}/rbenv.sh",
owner => root,
group => root,
mode => 644,
content => template('rbenv/dot.rbenvrc.erb'),
require => Exec["rbenv::checkout ${user}"],
}
}

file { "rbenv::rbenvrc ${user}":
path => $rbenvrc,
owner => $user,
Expand Down
2 changes: 1 addition & 1 deletion manifests/plugin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
command => "git clone ${source} ${destination}",
user => $user,
group => $group,
creates => $destination,
creates => "$destination/.git",
path => ['/bin', '/usr/bin', '/usr/sbin'],
timeout => $timeout,
cwd => $home_path,
Expand Down
3 changes: 2 additions & 1 deletion templates/dot.rbenvrc.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# has not been inited yet. Managed by puppet - DO NOT EDIT
#
if ! echo $PATH | grep -q rbenv; then
export PATH="<%= @root_path %>/bin:$PATH"
export RBENV_ROOT="<%= @root_path %>"
export PATH="${RBENV_ROOT}/bin:$PATH"
eval "$(rbenv init -)"
fi