Giter VIP home page Giter VIP logo

puppet-rbenv's Introduction

puppet-rbenv

Build Status Puppet Forge

Description

This Puppet module will install and manage rbenv. By default, it installs rbenv for systemwide use, rather than for a user or project. Additionally, you can install different versions of Ruby, rbenv plugins, and Ruby gems.

Installation

puppet module install --modulepath /path/to/puppet/modules jdowning-rbenv

Usage

To use this module, you must declare it in your manifest like so:

class { 'rbenv': }

If you wish to install rbenv somewhere other than the default (/usr/local/rbenv), you can do so by declaring the install_dir:

class { 'rbenv': install_dir => '/opt/rbenv' }

You can also ensure rbenv is kept up-to-date:

class { 'rbenv':
  install_dir => '/opt/rbenv'
  latest      => true
}

The class will merely setup rbenv on your host. If you wish to install rubies, plugins, or gems, you will have to add those declarations to your manifests as well.

Installing Ruby using ruby-build

Ruby requires additional packages to operate properly. Fortunately, this module will ensure these dependencies are met before installing Ruby. To install Ruby you will need the ruby-build plugin from @sstephenson. Once installed, you can install most any Ruby. Additionally, you can set the Ruby to be the global interpreter.

rbenv::plugin { 'sstephenson/ruby-build': }
rbenv::build { '2.0.0-p247': global => true }

Sometimes Ruby needs to be patched prior to being compiled. puppet-rbenv currently supports patching from a single file located either on the Puppet Master or the local filesystem. Therefore, the only accepted paths are those starting with puppet:/// or file:///.

rbenv::build { '2.0.0-p247': patch => 'puppet:///modules/rbenv/patch.patch' }
rbenv::build { '2.0.0-p247': patch => 'file:///path/to/patch.patch' }

Plugins

Plugins can be installed from GitHub using the following definiton:

rbenv::plugin { 'github_user/github_repo': }

You can ensure a plugin is kept up-to-date. This is helpful for a plugin like ruby-build so that definitions are always available:

rbenv::plugin { 'sstephenson/ruby-build': latest => true }

Gems

Gems can be installed too! You must specify the ruby_version you want to install for.

rbenv::gem { 'thor': ruby_version => '2.0.0-p247' }

Full Example

site.pp

class { 'rbenv': }
rbenv::plugin { [ 'sstephenson/rbenv-vars', 'sstephenson/ruby-build' ]: }
rbenv::build { '2.0.0-p247': global => true }
rbenv::gem { 'thor': ruby_version => '2.0.0-p247' }

Testing

You can test this module with rspec:

bundle install
bundle exec rake spec

Vagrant

You can also test this module in a Vagrant box. There are two box definitons included in the Vagrant file for CentOS and Ubuntu testing. You will need to use librarian-puppet to setup dependencies:

bundle install
bundle exec librarian-puppet install

To test both boxes:

vagrant up

To test one distribution:

vagrant up [centos|ubuntu]

puppet-rbenv's People

Contributors

jdowning avatar thaumazein avatar hawknewton avatar alustenberg avatar barruumrex avatar josephcrim avatar soylent avatar advisory-board-company avatar hytebyte avatar prachetasp avatar queeno avatar coop avatar mukaibot avatar

Watchers

Joseph Anthony Pasquale Holsten avatar James Cloos avatar  avatar  avatar Scott Cunningham avatar Alex Rowley avatar Justin Pace avatar Matthew Robinson avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.