Created
December 10, 2014 18:02
-
-
Save robbkidd/12f4ddfc8007529a9b84 to your computer and use it in GitHub Desktop.
Ugly Way to Get Chef to Install an RPM from a URL
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
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