Install puppet in rvm

rvm lets us specify specific versions of ruby to use in different directories,it leaves the system wide ruby installed untouched.


  • Install rvm
  • Install desired ruby version
  • Change to desired ruby version
  • Make it permanent only to a specific dir
  • Install the puppet gem
  • Modify the puppet startup script to pick our ruby
  • Test server/client

Install the rvm using the installer


echo insecure >> ~/.curlrc
[root@machine-node1 tmp]# ./rvm-installer
Downloading RVM from wayneeseguin branch master
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 125 100 125 0 0 78 0 0:00:01 0:00:01 --:--:-- 0
0 125 0 0 0 0 0 0 --:--:-- 0:00:03 --:--:-- 0
100 918k 100 918k 0 0 14241 0 0:01:06 0:01:06 --:--:-- 25817
Installing RVM to /usr/local/rvm/
Creating RVM system user group 'rvm'
Install done

Let us install puppet gem

After manually changing to the ruby version that we like

[root@machine-node1 ~]# ruby -v
ruby 1.8.5 (2006-08-25) [x86_64-linux]
cd puppet_test
rvm use 1.9.2
[root@machine-node1 puppet_test]# which ruby

We should maybe specify which version of the gem to install

gem install -v 2.7.9 puppet
Fetching: puppet-2.7.9.gem (100%)
Successfully installed puppet-2.7.9
1 gem installed
Installing ri documentation for puppet-2.7.9...
Installing RDoc documentation for puppet-2.7.9...

Lets check that
[root@machine-node1 gems]# ls
bundler-1.0.22 facter-1.6.5 puppet-2.7.9

Make a ruby version permanent for a specific directory

[root@machine-node1 puppet_test]# rvm --rvmrc --create 1.9.2
[root@machine-node1 puppet_test]# ls -a
. .. .rvmrc
cd .
[root@machine-node1 puppet_test]# ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]

This sets the desired ruby version every time we cd into this dir

Puppet client testing

[root@machine-node1 puppe_test]# ls
puppetd show sysconfig

This puppetd had to be modified to remove the #! line so that it doesn’t pick up the /usr/bin/ruby uses just ruby like below
ruby ${PWD}/puppetd --no-daemonize --server --waitforcert 20 -v -d

cd into the dir and ./, this picks us the specific ruby version because of the rvmrc file

notice: Starting Puppet client version 2.7.9
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/puppet-2.7.9/lib/puppet/provider/service/freebsd.rb:10: warning: class variable access from toplevel
info: Caching catalog for
info: Applying configuration version '1329913689'
notice: /Stage[main]/Hardening::Services/Hardening::Services::Service_stop[bluetooth]/Service[bluetooth]/ensure: ensure changed 'running' to 'stopped'
notice: Finished catalog run in 5.22 seconds
notice: Caught INT; calling stop

You should change the puppetmasterd file like what we did for the puppetd file, removing the shabang and adding just ruby to the invocation
Please comment on any other ways to test these


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: