diff --git a/README.markdown b/README.markdown index 29051cdc..3addda1a 100644 --- a/README.markdown +++ b/README.markdown @@ -66,6 +66,20 @@ You can tell RVM to install one or more Ruby versions with: You should use the full version number. While the shorthand version may work (e.g. '1.9.2'), the provider will be unable to detect if the correct version is installed. +## Installing Ruby with options / or packages (OR: *building Rubies with a modern OpenSSL*) + +RVM has several packages that provide required libraries for OS configurations that might not have up to date components. A good example of this is OpenSSL - Ruby 2.0 (for example) depends on OpenSSL 1.x, but most OSes ship with OpenSSL 0.9.x. + +There are two new parameters you can use: + + rvm_system_ruby { + 'ruby-1.8.7': + ensure => 'present', + pkg => "openssl", + install_opts => "--with-openssl-dir=$rvm_path/usr" + } + +This will tell RVM to install the openSSL package, then compile RVM with options that point the build process to the new OpenSSL path. ## Creating Gemsets diff --git a/lib/puppet/provider/rvm_system_ruby/rvm_system_ruby.rb b/lib/puppet/provider/rvm_system_ruby/rvm_system_ruby.rb index 9f5b433f..2db37b32 100644 --- a/lib/puppet/provider/rvm_system_ruby/rvm_system_ruby.rb +++ b/lib/puppet/provider/rvm_system_ruby/rvm_system_ruby.rb @@ -4,7 +4,13 @@ commands :rvmcmd => "/usr/local/rvm/bin/rvm" def create - rvmcmd "install", resource[:name] + if resource[:pkg] + #puts "rvm pkg install #{resource[:pkg]}" + rvmcmd "pkg", "install", resource[:pkg] + end + + options = resource[:install_opts] + rvmcmd "install", resource[:name], options set_default if resource.value(:default_use) end diff --git a/lib/puppet/type/rvm_system_ruby.rb b/lib/puppet/type/rvm_system_ruby.rb index 59069a10..0919e069 100644 --- a/lib/puppet/type/rvm_system_ruby.rb +++ b/lib/puppet/type/rvm_system_ruby.rb @@ -12,4 +12,13 @@ desc "Should this Ruby be the system default for new terminals?" defaultto false end + + newparam(:install_opts) do + desc "Flags to compile RVM with ie: --with-openssl-dir=..." + defaultto "" + end + + newparam(:pkg) do + desc "install package for this system ruby" + end end