All Projects → alup → Puppet Rbenv

alup / Puppet Rbenv

Licence: mit
Puppet manifest for rbenv installation

Labels

Projects that are alternatives of or similar to Puppet Rbenv

Vagrant Baseline
Dev sandbox with batteries included
Stars: ✭ 100 (-27.54%)
Mutual labels:  puppet
Puppet Debugger
A interactive live debugger and REPL for the puppet language
Stars: ✭ 117 (-15.22%)
Mutual labels:  puppet
System Config
MOVED: Now at https://opendev.org/opendev/system-config
Stars: ✭ 128 (-7.25%)
Mutual labels:  puppet
Puppet Gluster
puppet module for gluster
Stars: ✭ 104 (-24.64%)
Mutual labels:  puppet
Puppet Nodejs
Puppet module to install nodejs and global npm packages
Stars: ✭ 111 (-19.57%)
Mutual labels:  puppet
Puppetlabs spec helper
A set of shared spec helpers specific to Puppetlabs projects
Stars: ✭ 121 (-12.32%)
Mutual labels:  puppet
Puppet R10k
Setup and configure r10k for use with git based environments in puppet
Stars: ✭ 95 (-31.16%)
Mutual labels:  puppet
Rails Starter Box
Base Vagrant box for development of Rails apps
Stars: ✭ 136 (-1.45%)
Mutual labels:  puppet
Loom
Elegant deployment with Fabric and Puppet.
Stars: ✭ 115 (-16.67%)
Mutual labels:  puppet
Salt Sandbox
A Vagrant-based Salt development environment for creating new modules
Stars: ✭ 122 (-11.59%)
Mutual labels:  puppet
Govuk Puppet
Puppet manifests used to provision the main GOV.UK web stack
Stars: ✭ 109 (-21.01%)
Mutual labels:  puppet
Jerakia
A pluggable and extendable data lookup system
Stars: ✭ 111 (-19.57%)
Mutual labels:  puppet
Puppet Mcollective
MCollective Server and Client Puppet Module
Stars: ✭ 121 (-12.32%)
Mutual labels:  puppet
Vagrant Golang
A very easy to use golang environment for use with vagrant.
Stars: ✭ 104 (-24.64%)
Mutual labels:  puppet
Onceover
Your gateway drug to automated infrastructure testing with Puppet
Stars: ✭ 132 (-4.35%)
Mutual labels:  puppet
Hiera Http
HTTP backend for Hiera
Stars: ✭ 95 (-31.16%)
Mutual labels:  puppet
Cis Puppet
Center for Internet Security Linux Benchmark implementation for PuppetLabs
Stars: ✭ 117 (-15.22%)
Mutual labels:  puppet
Perl Dist Strawberry
Stars: ✭ 138 (+0%)
Mutual labels:  puppet
Wp Vagrant
WordPress Vagrant boxes for testing PHP 5.3, 5.4, and 5.5
Stars: ✭ 136 (-1.45%)
Mutual labels:  puppet
Serverfarmer
Manage multiple servers with different operating systems, configurations, requirements etc. for many separate customers in an outsourcing model.
Stars: ✭ 122 (-11.59%)
Mutual labels:  puppet

Puppet-Rbenv

Build Status endorse

About

This project provides powerful manifests for the installation of rbenv (Ruby Version Management). In a nutshell, it supports the following conveniences:

  • Defined resources for the installation of rbenvs for one or more users, shared or standalone.
  • Resources for the compilation of ruby interpreters (one or many, custom or predefined ruby build definitions), under specific rbenvs, users.
  • Tools for the installation of arbitrary gems under specific rbenvs.
  • Infrastructure to support rbenv plugins. We have already included ruby-build and rbenv-vars plugins.
  • Resource for handling bundler.

Rbenv installation

You can use the module in your manifest with the following code:

rbenv::install { "someuser":
  group => 'project',
  home  => '/project'
}

This will apply an rbenv installation under "someuser" home dir and place it into ".rbenv". You can change the resource title to your taste, and pass the user on which install rbenv using the user parameter.

The rbenv directory can be changed by passing the "root" parameter, that must be an absolute path.

Ruby compilation

To compile a ruby interpreter, you use rbenv::compile as follows:

rbenv::compile { "1.9.3-p327":
  user => "someuser",
  home => "/project",
}

The resource title is used as the ruby version, but if you have multiple rubies under multiple users, you'll have to define them explicitly:

rbenv::compile { "foo/1.8.7":
  user => "foo",
  ruby => "1.8.7-p370",
}

rbenv::compile { "bar/1.8.7":
  user => bar",
  ruby => "1.8.7-p370",
}

rbenv rehash is performed each time a new ruby or a new gem is installed.

You can use the global => true parameter to set an interpreter as the default (rbenv global) one for the given user. Please note that only one global is allowed, duplicate resources will be defined if you specify multiple global ruby version.

You can also provide a custom build definition to ruby-build by specifying a source that can either be a puppet: source or a file to be downloaded using wget:

rbenv::compile { "patched-ree":
  user   => "someuser",
  home   => "/project",
  source => "puppet://path-to-definition"
}

If you're using debugger gems, you'll probably need to keep source tree after building. This is achieved by passing keep => true parameter.

rbenv::compile { "bar/1.8.7":
  user => bar",
  ruby => "1.8.7-p370",
  keep => true,
}

Gem installation

You can install and keep gems updated for a specific ruby interpreter:

rbenv::gem { "unicorn":
  user => "foobarbaz",
  ruby => "1.9.3-p327",
}

Gems are handled using a custom Package provider that handles gems, somewhat inspired by Puppet's Package one - thus absent and latest work as expected.

You can specify a gem source with the optional source parameter:

rbenv::gem { "my_private_gem":
  user   => "foobarbaz",
  ruby   => "1.9.3-p327",
  source => "http://gems.mydoma.in/"
}

rbenv plugins

To add a plugin to a rbenv installation, you use rbenv::plugin as follows:

rbenv::plugin { "my-plugin":
  user   => "someuser",
  source => "git://github.com/user/my-plugin.git"
}

There's also a built-in resource to add rbenv-vars for a user:

rbenv::plugin::rbenvvars { "someuser":
  # Optional:
  # source => "git://path-to-your/custom/rbenv-vars.git"
}

NOTICE: rbenv::install automatically requires ruby-build to compile rubies, if you want to use a different repository, you can specify the resource on a separate manifest:

rbenv::plugin::rubybuild { "someuser":
  source => "git://path-to-your/git/repo"
}

Install module from puppet forge

You can install the latest release of this module by using the following command:

puppet module install alup-rbenv

Usage with Vagrant

A simple way to test this module is by using the Vagrant library.

An example of a Vagrantfile:

Vagrant::Config.run do |config|
   config.vm.box = "lucid32"
   config.vm.provision :puppet, :facter => { "osfamily" => "debian" }, :module_path => "modules" do |puppet|
     puppet.manifests_path = "manifests"
     puppet.manifest_file  = "base.pp"
     puppet.options        = %w[ --libdir=\\$modulepath/rbenv/lib ]
   end
end

The --libdir=\\$modulepath/rbenv/lib argument is important to make puppet aware of the rbenvgem custom provider and type.

Notes

This project contains a custom rbenvgem type for use by the client via module.

Custom types and facts (plugins) are gathered together and distributed via a file mount on your Puppet master.

To enable module distribution you need to make changes on both the Puppet master and the clients. Specifically, pluginsync must be enabled in puppet.conf configuration file on both the master and the clients.

[main]
pluginsync = true

Supported Platforms

  • CentOS
  • Debian
  • RHEL
  • SuSE
  • Ubuntu

License

MIT License.

Copyright 2012-2015 Andreas Loupasakis, Marcello Barnaba [email protected], Fabio Rehm

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].