GithubHelp home page GithubHelp logo

isabella232 / puppet-ruby Goto Github PK

View Code? Open in Web Editor NEW

This project forked from boxen/puppet-ruby

0.0 0.0 0.0 426 KB

Installs Ruby versions with Boxen

Home Page: http://boxen.github.com

License: MIT License

Ruby 71.77% Puppet 23.37% Shell 4.85%

puppet-ruby's Introduction

Ruby Puppet Module for Boxen

Build Status

Requires the following boxen modules:

  • boxen >= 3.2.0
  • repository >= 2.1
  • autoconf (some ruby versions)
  • openssl (ruby versions >= 2.0.0)
  • gcc (ruby versions <= 1.8.7)
  • ripienaar/puppet-module-data

About

This module supports ruby version management with either rbenv or chruby. All ruby versions are installed into /opt/rubies.

About ruby-build version

Occasional bumps to the default ruby-build version are fine, on this module, but not essential. The ruby-build version is something you should be managing in your own boxen repository, rather than depending on this module to update for you. See examples on how to change the ruby-build version in the Hiera section.

You can find a release list of versions for ruby-build here.

Breakages since last major version

  • ruby::global does not work with chruby
  • bundler is no longer installed by default
  • rubies now live in /opt/rubies instead of /opt/boxen/rbenv/versions
  • the module-data module is now required

Usage

# Set the global default ruby (auto-installs it if it can)
class { 'ruby::global':
  version => '2.4.0'
}

# ensure a certain ruby version is used in a dir
ruby::local { '/path/to/some/project':
  version => '2.4.0'
}

# ensure a gem is installed for a certain ruby version
# note, you can't have duplicate resource names so you have to name like so
$version = "2.4.0"
ruby_gem { "bundler for ${version}":
  gem          => 'bundler',
  version      => '~> 1.2.0',
  ruby_version => $version,
}

# ensure a gem is installed for all ruby versions
ruby_gem { 'bundler for all rubies':
  gem          => 'bundler',
  version      => '~> 1.0',
  ruby_version => '*',
}

# install a ruby version
ruby::version { '2.4.0': }

# Installing rbenv plugin
ruby::rbenv::plugin { 'rbenv-vars':
  ensure => 'v1.2.0',
  source  => 'sstephenson/rbenv-vars'
}

# Run an installed gem
exec { '/opt/rubies/2.4.0/bin/bundle install':
  cwd     => "~/src/project",
  require => Ruby_Gem['bundler for 2.4.0']
}

Hiera configuration

The following variables may be automatically overridden with Hiera:

---

"ruby::provider": "chruby"
"ruby::user": "deploy"

"ruby::build::ensure": "v20161225"
"ruby::chruby::ensure": "v0.3.9"
"ruby::rbenv::ensure": "v1.1.0"

# rbenv plugins
"ruby::rbenv::plugins":
  "rbenv-gem-rehash":
    "ensure": "v1.0.0"
    "source": "sstephenson/rbenv-gem-rehash"

# Environment variables for building specific versions
# You'll want to enable hiera's "deeper" merge strategy
# See http://docs.puppetlabs.com/hiera/1/configuring.html#mergebehavior
"ruby::version::env":
  "1.9.3-gentoo":
    "CC": "llvm"
    "CFLAGS": "-O9 -funroll-loops"
  "2.0.0-p0":
    "CC": "gcc"

# Version aliases, commonly used to bless a specific version
# Use the "deeper" merge strategy, as with ruby::version::env
"ruby::version::alias":
  "1.9.3": "1.9.3-p484"
  "2.0.0": "2.0.0-github"
  "2.0.0-github": "2.0.0-github6"

It is required that you include ripienaar/puppet-module-data in your boxen project, as this module now ships with many pre-defined versions and aliases in the data/ directory. With this module included, those definitions will be automatically loaded, but can be overridden easily in your own hierarchy.

You can also use JSON if your Hiera is configured for that.

puppet-ruby's People

Contributors

wfarr avatar dgoodlad avatar rafaelfranca avatar jacobbednarz avatar mikemcquaid avatar mislav avatar n0ts avatar timtim123456 avatar lsylvester avatar grosser avatar jbarnette avatar seanknox avatar createdbypete avatar dbussink avatar fromonesrc avatar tarebyte avatar lucasmazza avatar salimane avatar rodjek avatar johnsyweb avatar jhaals avatar davejachimiak avatar mnussbaum avatar cdenneen avatar tedkulp avatar petems avatar orien avatar nhocki avatar nickpellant avatar moox 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.