Created
April 13, 2011 16:09
-
-
Save neilmock/917837 to your computer and use it in GitHub Desktop.
chef definition for rvm installation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define :rvm_install do | |
url = "https://rvm.beginrescueend.com/install/rvm" | |
bash "installing rvm stable" do | |
user params[:name] | |
code <<-EOH | |
bash < <(curl -B #{url}) | |
EOH | |
not_if "which rvm" | |
end | |
node.rvm.rubies.each do |version| | |
bash "installing #{version}" do | |
user params[:name] | |
code "rvm install #{version}" | |
not_if "rvm list | grep #{version}" | |
end | |
bash "make #{version} the default ruby" do | |
user params[:name] | |
code "rvm --default #{version}" | |
not_if "rvm list | grep '=> #{version}'" | |
only_if { node[:rvm][:use] == version } | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment