Created
March 24, 2015 21:53
-
-
Save troyready/8481b641d98ec37f9efb to your computer and use it in GitHub Desktop.
chef-client 12.1 rbenv gem chef client recipe
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
include_recipe 'ruby_build' | |
include_recipe 'rbenv::user_install' | |
# Setup rbenv for app owner | |
git_url = node['rbenv']['git_url'] | |
git_ref = node['rbenv']['git_ref'] | |
home_dir = "/home/#{params[:owner]}" | |
rbenv_prefix = ::File.join(home_dir, '.rbenv') | |
install_or_upgrade_rbenv :rbenv_prefix => rbenv_prefix, | |
:home_dir => home_dir, | |
:git_url => git_url, | |
:git_ref => git_ref, | |
:upgrade_strategy => nil, | |
:user => params[:owner], | |
:group => params[:owner] | |
# Install ruby & gems for app owner | |
rbenv_ruby "#{params[:ruby_ver]} (#{params[:owner]})" do | |
definition params[:ruby_ver] | |
user params[:owner] | |
end | |
rbenv_global "#{params[:ruby_ver]} (#{params[:owner]})" do | |
rbenv_version params[:ruby_ver] | |
user params[:owner] | |
end | |
['bundler', 'rake'].each do |gem| | |
rbenv_gem "#{gem} (#{params[:owner]})" do | |
package_name gem | |
user params[:owner] | |
rbenv_version params[:ruby_ver] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment