From 4101766e1714d7893fc2d6e5da2ba979f33046e8 Mon Sep 17 00:00:00 2001 From: Andy Rosequist Date: Thu, 20 Jun 2013 14:30:15 -0400 Subject: [PATCH 1/6] install "creates" should be the .git --- manifests/install.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/install.pp b/manifests/install.pp index 7c01170..9e45189 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -21,7 +21,7 @@ command => "git clone https://github.com/sstephenson/rbenv.git ${root_path}", user => $user, group => $group, - creates => $root_path, + creates => "$root_path/.git", path => ['/usr/bin', '/usr/sbin'], timeout => 100, cwd => $home_path, From 3ca17d6b9dfd4f0d8630d077af5bca572034e80e Mon Sep 17 00:00:00 2001 From: Andy Rosequist Date: Thu, 20 Jun 2013 14:58:12 -0400 Subject: [PATCH 2/6] stronger "creates" for rbenv::plugin as well --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2884fc2..01b3429 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -31,7 +31,7 @@ command => "git clone ${source} ${destination}", user => $user, group => $group, - creates => $destination, + creates => "$destination/.git", path => ['/usr/bin', '/usr/sbin'], timeout => $timeout, cwd => $home_path, From d553d5e2e09f52c52f3ca6194f5bc19b82b5b963 Mon Sep 17 00:00:00 2001 From: Andy Rosequist Date: Fri, 5 Jul 2013 12:15:04 -0400 Subject: [PATCH 3/6] added a global profile directory option --- manifests/install.pp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/manifests/install.pp b/manifests/install.pp index 9e45189..80bd2f6 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -3,7 +3,8 @@ $group = $user, $home = '', $root = '', - $rc = ".profile" + $rc = ".profile", + $profile_d, ) { # Workaround http://projects.puppetlabs.com/issues/9848 @@ -28,6 +29,17 @@ require => Package['git'], } + if defined($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, From c6cdc398f4387d878d219d74a9b59cc6b896963a Mon Sep 17 00:00:00 2001 From: Andy Rosequist Date: Fri, 5 Jul 2013 14:41:07 -0400 Subject: [PATCH 4/6] better handing of profile_d --- manifests/install.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/install.pp b/manifests/install.pp index 80bd2f6..513e854 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -4,7 +4,7 @@ $home = '', $root = '', $rc = ".profile", - $profile_d, + $profile_d = '',, ) { # Workaround http://projects.puppetlabs.com/issues/9848 @@ -29,7 +29,7 @@ require => Package['git'], } - if defined($profile_d) { + if $profile_d { file { "rbenv::rbenvrc ${profile_d}": path => "${profile_d}/rbenv.sh", owner => root, From f9f51e0841cdaa66e763af3cd4c7cc5a1295aa6d Mon Sep 17 00:00:00 2001 From: Andy Rosequist Date: Fri, 5 Jul 2013 14:54:05 -0400 Subject: [PATCH 5/6] global profile_d --- manifests/install.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/install.pp b/manifests/install.pp index 513e854..05f00f0 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -4,7 +4,7 @@ $home = '', $root = '', $rc = ".profile", - $profile_d = '',, + $profile_d = '', ) { # Workaround http://projects.puppetlabs.com/issues/9848 From 4ce00c655411621044890e0791950489a2113483 Mon Sep 17 00:00:00 2001 From: Andy Rosequist Date: Mon, 8 Jul 2013 17:31:47 -0400 Subject: [PATCH 6/6] add RBENV_ROOT to rc --- templates/dot.rbenvrc.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/dot.rbenvrc.erb b/templates/dot.rbenvrc.erb index b680e6f..0e487ac 100644 --- a/templates/dot.rbenvrc.erb +++ b/templates/dot.rbenvrc.erb @@ -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