X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/28d3b4a01faa4780e97c15edc9575c24ff7944d0..b75beef9a192ca60ed4a0c41417d4e944cea02be:/cookbooks/apt/providers/source.rb diff --git a/cookbooks/apt/providers/source.rb b/cookbooks/apt/providers/source.rb index 048d1eeae..d3b710b85 100644 --- a/cookbooks/apt/providers/source.rb +++ b/cookbooks/apt/providers/source.rb @@ -30,9 +30,16 @@ action :create do only_if "/usr/bin/apt-key adv --list-keys #{new_resource.key} | fgrep expired" end - execute "apt-key-#{new_resource.key}-install" do - command "/usr/bin/apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys #{new_resource.key}" - not_if "/usr/bin/apt-key adv --list-keys #{new_resource.key}" + if new_resource.key_url + execute "apt-key-#{new_resource.key}-install" do + command "/usr/bin/apt-key adv --fetch-keys #{new_resource.key_url}" + not_if "/usr/bin/apt-key adv --list-keys #{new_resource.key}" + end + else + execute "apt-key-#{new_resource.key}-install" do + command "/usr/bin/apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys #{new_resource.key}" + not_if "/usr/bin/apt-key adv --list-keys #{new_resource.key}" + end end end