apt
apt-transport-https
gnupg
- update-notifier-common
]
+package "update-notifier-common" if platform?("ubuntu")
+
file "/etc/motd.tail" do
action :delete
end
action :nothing
end
-if intel?
+if platform?("debian")
+ archive_host = "deb.debian.org"
+ archive_security_host = archive_host
+ archive_distro = "debian"
+ archive_security_distro = "debian-security"
+ archive_suites = %w[main updates security]
+ archive_components = %w[main contrib non-free]
+elsif intel?
archive_host = if node[:country]
"#{node[:country]}.archive.ubuntu.com"
else
end
archive_security_host = "security.ubuntu.com"
archive_distro = "ubuntu"
+ archive_security_distro = archive_distro
+ archive_suites = %w[main updates backports security]
+ archive_components = %w[main restricted universe multiverse]
else
archive_host = "ports.ubuntu.com"
archive_security_host = archive_host
archive_distro = "ubuntu-ports"
+ archive_security_distro = archive_distro
+ archive_suites = %w[main updates backports security]
+ archive_components = %w[main restricted universe multiverse]
end
template "/etc/apt/sources.list" do
owner "root"
group "root"
mode "644"
- variables :archive_host => archive_host, :archive_security_host => archive_security_host, :archive_distro => archive_distro, :codename => node[:lsb][:codename]
+ variables :archive_host => archive_host,
+ :archive_security_host => archive_security_host,
+ :archive_distro => archive_distro,
+ :archive_security_distro => archive_security_distro,
+ :archive_suites => archive_suites,
+ :archive_components => archive_components,
+ :codename => node[:lsb][:codename]
notifies :update, "apt_update[/etc/apt/sources.list]", :immediately
end
apt_repository "openstreetmap" do
uri "ppa:osmadmins/ppa"
+ only_if { platform?("ubuntu") }
end
package "unattended-upgrades"
include_recipe "apt"
+docker_platform = if platform?("debian")
+ "debian"
+ else
+ "ubuntu"
+ end
+
docker_arch = if arm?
"arm64"
else
end
apt_repository "docker" do
- uri "https://download.docker.com/linux/ubuntu"
+ uri "https://download.docker.com/linux/#{docker_platform}"
arch docker_arch
components ["stable"]
- key "https://download.docker.com/linux/ubuntu/gpg"
+ key "https://download.docker.com/linux/#{docker_platform}/gpg"
end
include_recipe "apt"
+platform_name = if platform?("debian")
+ "debian"
+ else
+ "ubuntu"
+ end
+
+distribution_name = if platform?("debian")
+ "buster"
+ else
+ "precise"
+ end
+
apt_repository "hwraid" do
- uri "https://hwraid.le-vert.net/ubuntu"
- distribution "precise"
+ uri "https://hwraid.le-vert.net/#{platform_name}"
+ distribution distribution_name
components ["main"]
key "6005210E23B3D3B4"
end
action :remove
end
-if node[:dmi][:system][:product_name].end_with?("Gen10")
- apt_repository "mcp-jammy" do
- uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
- distribution "jammy/current"
- components ["non-free"]
- key "C208ADDE26C2B797"
+if platform?("debian")
+ if node[:dmi][:system][:product_name].end_with?("Gen10")
+ apt_repository "mcp-gen10" do
+ uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
+ distribution "#{node[:lsb][:codename]}/current-gen10"
+ components ["non-free"]
+ key "C208ADDE26C2B797"
+ end
+ else
+ apt_repository "mcp" do
+ uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
+ distribution "#{node[:lsb][:codename]}/current"
+ components ["non-free"]
+ key "C208ADDE26C2B797"
+ end
end
+elsif platform?("ubuntu")
+ if node[:dmi][:system][:product_name].end_with?("Gen10")
+ apt_repository "mcp-jammy" do
+ uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
+ distribution "jammy/current"
+ components ["non-free"]
+ key "C208ADDE26C2B797"
+ end
- apt_repository "mcp-focal-gen10" do
- uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
- distribution "focal/current-gen10"
- components ["non-free"]
- key "C208ADDE26C2B797"
- end
-else
- apt_repository "mcp-bionic-gen9" do
- uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
- distribution "bionic/current-gen9"
- components ["non-free"]
- key "C208ADDE26C2B797"
+ apt_repository "mcp-focal-gen10" do
+ uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
+ distribution "focal/current-gen10"
+ components ["non-free"]
+ key "C208ADDE26C2B797"
+ end
+ else
+ apt_repository "mcp-bionic-gen9" do
+ uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
+ distribution "bionic/current-gen9"
+ components ["non-free"]
+ key "C208ADDE26C2B797"
+ end
end
end
apt_repository "maxmind" do
uri "ppa:maxmind/ppa"
+ only_if { platform?("ubuntu") }
end
include_recipe "apt"
+platform_name = if platform?("debian")
+ "debian"
+ else
+ "ubuntu"
+ end
+
apt_repository "nginx" do
arch "amd64"
- uri "https://nginx.org/packages/ubuntu"
+ uri "https://nginx.org/packages/#{platform_name}"
components ["nginx"]
key "ABF5BD827BD9BF62"
end
include_recipe "apt"
include_recipe "apt::postgresql"
+platform_name = if platform?("debian")
+ "debian"
+ else
+ "ubuntu"
+ end
+
apt_repository "timescaledb" do
- uri "https://packagecloud.io/timescale/timescaledb/ubuntu"
+ uri "https://packagecloud.io/timescale/timescaledb/#{platform_name}"
components ["main"]
key "https://packagecloud.io/timescale/timescaledb/gpgkey"
end
# DO NOT EDIT - This file is being maintained by Chef
+<% if @archive_suites.include?("main") -%>
-deb http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %> main restricted
-# deb-src http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %> main restricted
+deb http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %> <%= @archive_components.join(" ") %>
+# deb-src http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %> <%= @archive_components.join(" ") %>
+<% end -%>
+<% if @archive_suites.include?("updates") -%>
-## Major bug fix updates produced after the final release of the
-## distribution.
-deb http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %>-updates main restricted
-# deb-src http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %>-updates main restricted
+deb http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %>-updates <%= @archive_components.join(" ") %>
+# deb-src http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %>-updates <%= @archive_components.join(" ") %>
+<% end -%>
+<% if @archive_suites.include?("backports") -%>
-## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
-## team. Also, please note that software in universe WILL NOT receive any
-## review or updates from the Ubuntu security team.
-deb http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %> universe
-# deb-src http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %> universe
-deb http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %>-updates universe
-# deb-src http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %>-updates universe
+deb http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %>-backports <%= @archive_components.join(" ") %>
+# deb-src http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %>-backports <%= @archive_components.join(" ") %>
+<% end -%>
+<% if @archive_suites.include?("security") -%>
-## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
-## team, and may not be under a free licence. Please satisfy yourself as to
-## your rights to use the software. Also, please note that software in
-## multiverse WILL NOT receive any review or updates from the Ubuntu
-## security team.
-deb http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %> multiverse
-# deb-src http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %> multiverse
-deb http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %>-updates multiverse
-# deb-src http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %>-updates multiverse
-
-## N.B. software from this repository may not have been tested as
-## extensively as that contained in the main release, although it includes
-## newer versions of some applications which may provide useful features.
-## Also, please note that software in backports WILL NOT receive any review
-## or updates from the Ubuntu security team.
-deb http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %>-backports main restricted universe multiverse
-# deb-src http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %>-backports main restricted universe multiverse
-
-deb http://<%= @archive_security_host %>/<%= @archive_distro %>/ <%= @codename %>-security main restricted
-# deb-src http://<%= @archive_security_host %>/<%= @archive_distro %>/ <%= @codename %>-security main restricted
-deb http://<%= @archive_security_host %>/<%= @archive_distro %>/ <%= @codename %>-security universe
-# deb-src http://<%= @archive_security_host %>/<%= @archive_distro %>/ <%= @codename %>-security universe
-deb http://<%= @archive_security_host %>/<%= @archive_distro %>/ <%= @codename %>-security multiverse
-# deb-src http://<%= @archive_security_host %>/<%= @archive_distro %>/ <%= @codename %>-security multiverse
+deb http://<%= @archive_security_host %>/<%= @archive_security_distro %>/ <%= @codename %>-security <%= @archive_components.join(" ") %>
+# deb-src http://<%= @archive_security_host %>/<%= @archive_security_distro %>/ <%= @codename %>-security <%= @archive_components.join(" ") %>
+<% end -%>