From 7a548873037c235b29861637bc51d199ec63728a Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 3 May 2026 15:52:09 +0100 Subject: [PATCH] Fix issues with HP repositories on Debian --- cookbooks/apt/recipes/management-component-pack.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/cookbooks/apt/recipes/management-component-pack.rb b/cookbooks/apt/recipes/management-component-pack.rb index 8132032f7..9874d5e26 100644 --- a/cookbooks/apt/recipes/management-component-pack.rb +++ b/cookbooks/apt/recipes/management-component-pack.rb @@ -24,17 +24,23 @@ apt_repository "management-component-pack" do end if platform?("debian") - distribution = if node[:lsb][:codename] == "trixie" + distribution = if node[:lsb][:release].to_f > 12 "bookworm" else node[:lsb][:codename] end + legacy_key_options = if node[:lsb][:release].to_f > 12 + ["allow-insecure=yes"] + else + [] + end + apt_repository "mcp" do uri "https://downloads.linux.hpe.com/SDR/repo/mcp" distribution "#{distribution}/current" components ["non-free"] - key ["https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub", "https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key2.pub"] + key "https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key2.pub" end if node.dig(:dmi, :system, :product_name).to_s.end_with?("Gen9") @@ -42,7 +48,8 @@ if platform?("debian") uri "https://downloads.linux.hpe.com/SDR/repo/mcp" distribution "stretch/current-gen9" components ["non-free"] - key ["https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub", "https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key2.pub"] + key "https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub" + options legacy_key_options end end elsif platform?("ubuntu") -- 2.39.5