Skip to content

Instantly share code, notes, and snippets.

@charlesjohnson
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save charlesjohnson/2c9ba3f35ed11bf0b086 to your computer and use it in GitHub Desktop.
Save charlesjohnson/2c9ba3f35ed11bf0b086 to your computer and use it in GitHub Desktop.
Drop a gemrc and install packages to Chef's ruby context
template '/root/.gemrc' do
source 'gemrc.erb'
action :create
notifies :run, 'ruby_block[refresh_gemrc]', :immediately
end
# Thanks to http://lists.opscode.com/sympa/arc/chef/2013-12/msg00237.html
ruby_block 'refresh_gemrc' do
action :nothing
block do
Gem.configuration = Gem::ConfigFile.new []
end
end
gem_package 'di-ruby-lvm' do
gem_binary '/opt/chef/embedded/bin/gem'
action :install
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment