From 722b97558136dea2f12eaedb2a86035fe7b49ce8 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Wed, 8 Nov 2023 17:42:49 +0100 Subject: [PATCH 1/2] Cleanup architecture selection, dont fail on unknown architecture prometheus exporters are built for so many architectures, chances are high that a platform we're not aware of works out of the box. We should not block this. --- manifests/init.pp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 63aa5c069..c4dfb7b9d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -312,16 +312,13 @@ Optional[Enum['none', 'http', 'https', 'ftp']] $proxy_type = undef, ) { case $arch { - 'x86_64', 'amd64': { $real_arch = 'amd64' } - 'i386': { $real_arch = '386' } - 'aarch64': { $real_arch = 'arm64' } - 'armv7l': { $real_arch = 'armv7' } - 'armv6l': { $real_arch = 'armv6' } - 'armv5l': { $real_arch = 'armv5' } - 'ppc64le': { $real_arch = 'ppc64le' } - default: { - fail("Unsupported kernel architecture: ${arch}") - } + 'x86_64': { $real_arch = 'amd64' } + 'i386': { $real_arch = '386' } + 'aarch64': { $real_arch = 'arm64' } + 'armv7l': { $real_arch = 'armv7' } + 'armv6l': { $real_arch = 'armv6' } + 'armv5l': { $real_arch = 'armv5' } + default: { $real_arch = $arch } } if $manage_prometheus_server { From 87a1a189048c1f6a7dd3d39242ef743df8e776e9 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Wed, 8 Nov 2023 17:46:03 +0100 Subject: [PATCH 2/2] architecture selection: switch to selector --- manifests/init.pp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index c4dfb7b9d..aa9a65e37 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -311,14 +311,14 @@ Optional[String[1]] $proxy_server = undef, Optional[Enum['none', 'http', 'https', 'ftp']] $proxy_type = undef, ) { - case $arch { - 'x86_64': { $real_arch = 'amd64' } - 'i386': { $real_arch = '386' } - 'aarch64': { $real_arch = 'arm64' } - 'armv7l': { $real_arch = 'armv7' } - 'armv6l': { $real_arch = 'armv6' } - 'armv5l': { $real_arch = 'armv5' } - default: { $real_arch = $arch } + $real_arch = $arch ? { + 'x86_64' => 'amd64', + 'i386' => '386', + 'aarch64' => 'arm64', + 'armv7l' => 'armv7', + 'armv6l' => 'armv6', + 'armv5l' => 'armv5', + default => $arch, } if $manage_prometheus_server {