From: Tom Hughes Date: Tue, 6 Sep 2016 14:28:12 +0000 (+0100) Subject: Update HP key X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/62e4ecb57749d4c45eeed2fc5e8bba1fac2f92bc Update HP key --- 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 diff --git a/cookbooks/apt/recipes/default.rb b/cookbooks/apt/recipes/default.rb index cc6e47069..2573990a5 100644 --- a/cookbooks/apt/recipes/default.rb +++ b/cookbooks/apt/recipes/default.rb @@ -18,6 +18,7 @@ # package "apt" +package "gnupg-curl" package "update-notifier-common" file "/etc/motd.tail" do @@ -73,7 +74,8 @@ end apt_source "management-component-pack" do template "hp.list.erb" url "http://downloads.linux.hpe.com/SDR/repo/mcp" - key "B1275EA3" + key "26C2B797" + key_url "https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub" end apt_source "hwraid" do diff --git a/cookbooks/apt/resources/source.rb b/cookbooks/apt/resources/source.rb index 8669857c7..83fc3577f 100644 --- a/cookbooks/apt/resources/source.rb +++ b/cookbooks/apt/resources/source.rb @@ -24,6 +24,7 @@ attribute :name, :kind_of => String, :name_attribute => true attribute :template, :kind_of => String, :default => "default.list.erb" attribute :url, :kind_of => String, :required => true attribute :key, :kind_of => String +attribute :key_url, :kind_of => String def initialize(name, run_context = nil) super(name, run_context)