Skip to content

Instantly share code, notes, and snippets.

@neilmock
Created April 13, 2011 16:09
Show Gist options
  • Save neilmock/917837 to your computer and use it in GitHub Desktop.
Save neilmock/917837 to your computer and use it in GitHub Desktop.
chef definition for rvm installation
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