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 apt_repository "mcp" do
28 uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
29 distribution "#{node[:lsb][:codename]}/current"
30 components ["non-free"]
31 key ["https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub", "https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key2.pub"]
34 # Workaround v18.8.11 bug: https://github.com/chef/chef/issues/15214
35 if Chef::VERSION == "18.8.11"
36 edit_resource(:file, "/etc/apt/keyrings/mcp.gpg") do
37 action :create_if_missing
41 if node[:dmi][:system][:product_name].end_with?("Gen9")
42 apt_repository "mcp-gen9" do
43 uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
44 distribution "stretch/current-gen9"
45 components ["non-free"]
46 key ["https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub", "https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key2.pub"]
49 # Workaround v18.8.11 bug: https://github.com/chef/chef/issues/15214
50 if Chef::VERSION == "18.8.11"
51 edit_resource(:file, "/etc/apt/keyrings/mcp-gen9.gpg") do
52 action :create_if_missing
57 elsif platform?("ubuntu")
58 if node[:dmi][:system][:product_name].end_with?("Gen10")
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 # Workaround v18.8.11 bug: https://github.com/chef/chef/issues/15214
67 if Chef::VERSION == "18.8.11"
68 edit_resource(:file, "/etc/apt/keyrings/mcp-jammy.gpg") do
69 action :create_if_missing
73 apt_repository "mcp-focal-gen10" do
74 uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
75 distribution "focal/current-gen10"
76 components ["non-free"]
77 key ["https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub", "https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key2.pub"]
80 # Workaround v18.8.11 bug: https://github.com/chef/chef/issues/15214
81 if Chef::VERSION == "18.8.11"
82 edit_resource(:file, "/etc/apt/keyrings/mcp-focal-gen10.gpg") do
83 action :create_if_missing
87 apt_repository "mcp-bionic-gen9" do
88 uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
89 distribution "bionic/current-gen9"
90 components ["non-free"]
91 key ["https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub", "https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key2.pub"]
94 # Workaround v18.8.11 bug: https://github.com/chef/chef/issues/15214
95 if Chef::VERSION == "18.8.11"
96 edit_resource(:file, "/etc/apt/keyrings/mcp-bionic-gen9.gpg") do
97 action :create_if_missing