This module can be used to install ruby+gems for a single user by using rvm internally. It depends on eirc's single_user_rvm
module.
- Latest Release:
- Official Site: http://dracoblue.net/
puppet-rvm is copyright 2014-2015 by DracoBlue http://dracoblue.net
Latest version from puppet forge:
$ puppet module install DracoBlue-rvm
Latest version from git.
$ cd modules
$ git clone https://github.com/DracoBlue/puppet-rvm.git rvm
puppetlabs/stdlib >= 4.0.0
eirc/single_user_rvm >= 0.3.0
user { "blog":
}
rvm::ruby { "my blog":
user => "blog",
version => "ruby-2.0.0-p247"
}
rvm::gem { "jekyll":
ruby => Rvm::Ruby["my blog"],
ensure => "1.5.0"
}
rvm::gem { ["jekyll-sass", "sass", "sass-globbing", "therubyracer"]:
ruby => Rvm::Ruby["blog"],
require => [Rvm::Gem["jekyll"]]
}
Result:
/home/blog/.rvm
contains a rvm installationruby
is available as versionruby-2.0.0-p247
- the gem
jekyll
is available in version1.5.0
- the gems
jekyll-sass
, ... are present on the system
Define which $version
of ruby is installed for the $user
.
rvm::ruby { "my blog":
user => "blog",
version => "ruby-2.0.0-p247"
}
Define which version (in $ensure
) of $gem
must be installed. You may use $name
as shortcut for $gem
.
rvm::gem { "my blog's jekyll":
ruby => Rvm::Ruby["my blog"],
gem => "jekyll",
ensure => "1.5.0"
}
To make gem present in at least one version:
rvm::gem { "jekyll":
ruby => Rvm::Ruby["my blog"],
}
To ensure it's uninstalled:
rvm::gem { "jekyll":
ruby => Rvm::Ruby["my blog"],
ensure => 'absent'
}
Is a shell provider based version of exec, which runs the command in a bash login shell. This makes rvm
and a proper
$PATH
available in the environment.
The rvm::bash_exec
command is used by rvm::gem
and rvm::ruby
to set up and work in the users environment.
rvm::bash_exec { "run jekyll":
user => "blog",
command => "jekyll build"
}
Hint: rvm::bash_exec
tries to behave exactly like exec
. Internally it does a su - $USER
+ bash --login
and heavy
eascaping on quotation marks. So if you want to run a command only under certian conditions, use puppets unless
and
onlyif
parameters instead of such: if [ ... ]; then ... else; fi
stuff.
- 0.3.0 (2015/01/31)
- added gpg key installation to fix eirc/puppet-single_user_rvm#5
- 0.2.1 (2014/04/10)
- replaced self made shell arg escaping with puppets shellquote #1
- 0.2.0 (2014/03/31)
- fixed cwd in
rvm::bash_exec
#1 - renamed
rvm::bash-exec
torvm::bash_exec
- fixed cwd in
- 0.1.0 (2014/03/30)
- Initial release
- make tests available (before 1.x release)
puppet-rvm is licensed under the terms of MIT.