summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2012-11-20 19:08:45 -0500
committerMicah Anderson <micah@riseup.net>2012-11-20 19:08:45 -0500
commitcef8d7f65cb9f7931625a900b00a53ffb2848f12 (patch)
tree6f97ab93fd61add53bae63cff3252ae28d37d9a1 /manifests
parent038f71b44b1937dd1f349386b6af1a162091c3db (diff)
fix $install_method to work properly
unfortunately, if one attempts to set the $install_method to an empty string, puppet complains that you are interning an empty string. If you set it to undef, then the parameterized default will get chosen. To fix this, I replaced the $bundler::params::install_method default class parameter value with 'rvm' (the value that $bundler::params::install_method defaulted to) and then setup a test to determine if the $install_method was set to undef, if so, then we set a second variable ($provider_method) to undef and use that.
Diffstat (limited to 'manifests')
-rw-r--r--manifests/install.pp13
1 files changed, 10 insertions, 3 deletions
diff --git a/manifests/install.pp b/manifests/install.pp
index 73ceb59..4111d52 100644
--- a/manifests/install.pp
+++ b/manifests/install.pp
@@ -20,10 +20,17 @@
class bundler::install (
$ruby_version = undef,
$ensure = 'present',
- $install_method = $bundler::params::install_method,
+ $install_method = 'rvm',
) inherits bundler::params {
- if $install_method == 'rvm' {
+ if $install_method == undef {
+ $provider_method = undef
+ }
+ else {
+ $provider_method = $bundler::params::install_method
+ }
+
+ if $provider_method == 'rvm' {
if $ruby_version == undef {
fail('When using rvm, you must pass a ruby_version')
}
@@ -38,7 +45,7 @@ class bundler::install (
else {
package { 'bundler':
ensure => $ensure,
- provider => $install_method,
+ provider => $provider_method,
}
}