ruby
Version information
This version is compatible with:
Start using this module
Add this module to your Puppetfile:
mod 'covermymeds-ruby', '1.0.1'
Learn more about managing modules with a PuppetfileDocumentation
puppet-ruby
This module installs one or more Ruby versions via Red Hat Software Collections, as well as an optional list of gems.
The full functionality of this module requires Hiera.
Rubies
To simply ensure that one or more Ruby versions are installed, use the base ruby
class with an array of Ruby Software Collections names:
class { ruby:
$rubies => [ 'ruby200', 'rh-ruby22', ],
}
The first Ruby in the array will be considered the default Ruby, and will be activated for all bash users.
Gems
Gems can be installed system-wide on a per-Ruby basis.
ruby::gems { 'ruby193':
gems => { 'bundler' = { 'version' => '1.0.0' },
'rails' = { 'version' => '4.0.0' },
},
}
ruby::gems { 'rh-ruby22':
gems => { 'bundler' = { 'version' => '1.10.6' },
'rails' = { 'version' => '4.2.3' },
},
}
Any Gem executable (binary or script) will be installed into /opt/rh/<ruby>/root/usr/local/bin
, and that directory will be added to the PATH
environment variable inside the relevant Software Collection enable script. This ensures that Gem executables will be available when the Software Collection is enabled.
The default Gem installation options include --no-ridoc
and --no-rdoc
. If you wish to install documentation, you may do so:
ruby::gems { 'rh-ruby22':
gems => { 'bundler' = { 'version' => '1.10.16',
'ridoc' => true,
'rdoc' => true,
},
},
}
Please note that the ruby::gems
defined type is a wrapper around the ruby::gem
defined type. You may use the latter, if you wish, but please consult the code for details. You're likely better off using ruby::gems
unless you have very specific needs.
Hiera
This module is completely compatible with Hiera, and indeed works best with it.
To install multiple Software Collections Rubies from Hiera:
---
ruby::rubies:
- ruby200
- rh-ruby22
The first Ruby in the array will be considered the default Ruby, and will be activated for all bash users.
The base Ruby class performs an explicit hiera_hash()
lookup for gems to install across all Ruby versions.
One or more gems may be installed for each Ruby version using the ruby::gems
Hiera hash. The version of each gem to install is mandatory.
---
ruby::gems:
bundler:
version: 1.7.3
If you have gems that are only to be installed to a specific SCL Ruby version, you can add another Hiera hash named after the Ruby version:
---
ruby::gems::ruby193:
rubygems-bundler:
version: 1.1.0
The above will ensure that the rubygems-bundler
gem will only be installed to Ruby 1.9.3, regardless of what other Rubies are installed.
The default for SCL gems is to pass --no-ridoc
and --no-rdoc
to the installation command. If you would like to install documentation, add the appropriate boolean to the gem hash entry:
---
ruby::gems:
bundler:
version: 1.7.3
ridoc: true
rdoc: true
Contributing
Pull requests are warmly welcomed!
Copyright
Copyright 2015 CoverMyMeds and released under the terms of the MIT License.
- Fri Jul 24 2015 Scott Merrill smerrill@covermymeds.com - 1.0.1
- version bump for publication to Puppet Forge
- Fri Jul 24 2015 Scott Merrill smerrill@covermymeds.com - 1.0.0
- initial release
Dependencies
- puppetlabs/stdlib (>=4.6.0)
The MIT License (MIT) Copyright (c) 2015 CoverMyMeds Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.