Skip to content

Instantly share code, notes, and snippets.

@robbkidd
Created December 10, 2014 18:02
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 robbkidd/12f4ddfc8007529a9b84 to your computer and use it in GitHub Desktop.
Save robbkidd/12f4ddfc8007529a9b84 to your computer and use it in GitHub Desktop.
Ugly Way to Get Chef to Install an RPM from a URL
where_the_cool_packages_at = {}
where_the_cool_packages_at << { :package => "awesomeness.rpm", # this will be used as the downloaded filename
:url => "https://awesomesauce.example.com/download/this/awesomeness.rpm" # where to get it
}
where_the_cool_packages_at << { :package => "otherthing.rpm",
:url => "https://someotherthing.example.com/download/the/otherthing.rpm"
}
where_the_cool_packages_at.each do |package, url|
# download the thing from `url` and put it in Chef's file cache
remote_file "#{Chef::Config[:file_cache_path]}/#{package}" do
source url
end
# install that thing you downloaded from the Chef file cache
rpm_package package do |pkg|
source "#{Chef::Config[:file_cache_path]}/#{package}"
action :install
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment