summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md22
-rw-r--r--manifests/install.pp14
-rw-r--r--manifests/params.pp3
3 files changed, 25 insertions, 14 deletions
diff --git a/README.md b/README.md
index fbeb83f..a792b86 100644
--- a/README.md
+++ b/README.md
@@ -9,14 +9,22 @@ This module supports Ubuntu 10.04 and Debian
Installation
------------
-1. Copy this directory to your puppet master module path $(git clone https://github.com/evanstachowiak/puppet-bundler bundler)
-2. Apply the `bundler` class to any nodes you want bundler installed on:
+1. Copy this directory to your puppet master module path $(git clone
+https://github.com/evanstachowiak/puppet-bundler bundler)
+
+2. Apply the `bundler` class to any nodes you want bundler installed on:
+
class { 'bundler::install': }
- By default this will install bundler as a gem, if you wish to use another method, you can pass any puppet package provider
- to the class as 'install_method', or use 'undef' if you wish the puppet parser to automatically chose the best method for
- your platform.
- Examples: class { 'bundler::install': install_method => fink};
- class { 'bundler::install': install_method => undef}
+
+ By default this will install bundler with RVM, if you wish to use another
+ method, you can pass any puppet package provider to the class as
+ 'install_method', or just use '' if you wish the puppet parser to
+ automatically chose the best method for your platform.
+
+ Examples: class { 'bundler::install': install_method => 'fink' };
+ class { 'bundler::install': install_method => 'gem' };
+ class { 'bundler::install': install_method => '' }
+
3. Set whatever config variables are necessary:
bundler::config { 'linecache19':
user => ubuntu,
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'