summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2012-11-20 17:36:12 -0500
committerMicah Anderson <micah@riseup.net>2012-11-20 17:36:12 -0500
commit038f71b44b1937dd1f349386b6af1a162091c3db (patch)
treece01697a901bf4543a86b275d1b2d70e3c0472bd /manifests
parentf7ceb6d84bf692b98148f75be7cc6584a55bf1a3 (diff)
replace $use_rvm with $install_method to enable more flexible installation
possibilities The $use_rvm variable was limited to either using rvm or not, so we replace that with $install_method, defaulting to the previous usage If you set $use_rvm it to not use rvm, then the module would just use the gem. This made it so you couldn't install bundler via a package. So the $install_method was added which enabled you to alter how the non-rvm installation was provided. Unfortunately, it was a mistake to have both $use_rvm and $install_method because $use_rvm is 'true' by default, so if you tried to set an install_method, then it wouldn't work because it would just use the rvm method. So in order to install via something other than rvm or gem, you would need to do both use_rvm => false; install_method => <whatever>. Just having the install_method parameter is much cleaner, because it is generic, doesn't require multiple settings when not installing via rvm or gem, and it defaults to what the module was doing before (using rvm by default).
Diffstat (limited to 'manifests')
-rw-r--r--manifests/install.pp14
-rw-r--r--manifests/params.pp3
2 files changed, 10 insertions, 7 deletions
diff --git a/manifests/install.pp b/manifests/install.pp
index e464390..73ceb59 100644
--- a/manifests/install.pp
+++ b/manifests/install.pp
@@ -18,17 +18,21 @@
# include rvm
#
class bundler::install (
- $ruby_version,
+ $ruby_version = undef,
$ensure = 'present',
- $use_rvm = $bundler::params::use_rvm,
$install_method = $bundler::params::install_method,
) inherits bundler::params {
- if $use_rvm == true {
- #Install bundler with correct RVM
- rvm_gem { 'bundler':
+ if $install_method == 'rvm' {
+ if $ruby_version == undef {
+ fail('When using rvm, you must pass a ruby_version')
+ }
+ else {
+ #Install bundler with correct RVM
+ rvm_gem { 'bundler':
ensure => $ensure,
ruby_version => $ruby_version,
+ }
}
}
else {
diff --git a/manifests/params.pp b/manifests/params.pp
index b80dbab..53ca86e 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -17,8 +17,7 @@ class bundler::params {
ubuntu, debian: {
$user = 'root'
$home_dir_base_path = '/home'
- $use_rvm = true
- $install_method = gem
+ $install_method = 'rvm'
$rvm_bin = '/usr/local/rvm/bin/rvm'
$rvm_gem_path = '/usr/local/rvm/gems'
$rvm_gemset = 'global'