3 # Recipe:: management-component-pack
5 # Copyright:: 2022, Tom Hughes
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # https://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
22 apt_repository "management-component-pack" do
26 if platform?("debian")
27 # Force re-download of keyring
28 file "/etc/apt/keyrings/mcp.gpg" do
30 only_if { ::File.exist?("/etc/apt/keyrings/mcp.gpg") && ::File.mtime("/etc/apt/keyrings/mcp.gpg").to_date < Date.new(2025, 12, 9) }
32 apt_repository "mcp" do
33 uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
34 distribution "#{node[:lsb][:codename]}/current"
35 components ["non-free"]
36 key ["https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub", "https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key2.pub"]
39 if node.dig(:dmi, :system, :product_name).to_s.end_with?("Gen9")
40 # Force re-download of keyring
41 file "/etc/apt/keyrings/mcp-gen9.gpg" do
43 only_if { ::File.exist?("/etc/apt/keyrings/mcp-gen9.gpg") && ::File.mtime("/etc/apt/keyrings/mcp-gen9.gpg").to_date < Date.new(2025, 12, 9) }
45 apt_repository "mcp-gen9" do
46 uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
47 distribution "stretch/current-gen9"
48 components ["non-free"]
49 key ["https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub", "https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key2.pub"]
52 elsif platform?("ubuntu")
53 if node.dig(:dmi, :system, :product_name).to_s.end_with?("Gen10")
54 # Force re-download of keyring
55 file "/etc/apt/keyrings/mcp-jammy.gpg" do
57 only_if { ::File.exist?("/etc/apt/keyrings/mcp-jammy.gpg") && ::File.mtime("/etc/apt/keyrings/mcp-jammy.gpg").to_date < Date.new(2025, 12, 9) }
59 apt_repository "mcp-jammy" do
60 uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
61 distribution "jammy/current"
62 components ["non-free"]
63 key ["https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub", "https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key2.pub"]
66 # Force re-download of keyring
67 file "/etc/apt/keyrings/mcp-focal-gen10.gpg" do
69 only_if { ::File.exist?("/etc/apt/keyrings/mcp-focal-gen10.gpg") && ::File.mtime("/etc/apt/keyrings/mcp-focal-gen10.gpg").to_date < Date.new(2025, 12, 9) }
71 apt_repository "mcp-focal-gen10" do
72 uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
73 distribution "focal/current-gen10"
74 components ["non-free"]
75 key ["https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub", "https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key2.pub"]
78 # Force re-download of keyring
79 file "/etc/apt/keyrings/mcp-bionic-gen9.gpg" do
81 only_if { ::File.exist?("/etc/apt/keyrings/mcp-bionic-gen9.gpg") && ::File.mtime("/etc/apt/keyrings/mcp-bionic-gen9.gpg").to_date < Date.new(2025, 12, 9) }
83 apt_repository "mcp-bionic-gen9" do
84 uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
85 distribution "bionic/current-gen9"
86 components ["non-free"]
87 key ["https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub", "https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key2.pub"]