Skip to content

Instantly share code, notes, and snippets.

@meineerde
Last active December 15, 2015 16:39
Show Gist options
  • Save meineerde/5291023 to your computer and use it in GitHub Desktop.
Save meineerde/5291023 to your computer and use it in GitHub Desktop.
Chef: download a gem file and install it during compile phase.
chef_gem "my_gem"
source "#{Chef::Config[:file_cache_path]}/my.gem"
# only do anything if we are notified
action :nothing
end
remote_file "#{Chef::Config[:file_cache_path]}/my.gem" do
source "http://example.com/my.gem"
checksum "deadbeefdeadbeefdeadbeef"
notifies :install, "chef_gem[my_gem]", :immediately
action :nothing
end.run_action(:create)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment