From dcbe2a9fa07c31b832841547a9a9778fc56498e3 Mon Sep 17 00:00:00 2001 From: David Cachau Date: Fri, 8 Aug 2025 22:35:05 +0200 Subject: [PATCH] Add support for ACNG HTTPS proxy for DEB822 sources --- manifests/source.pp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/manifests/source.pp b/manifests/source.pp index 54adeeccf3..3e1f1cfcc6 100644 --- a/manifests/source.pp +++ b/manifests/source.pp @@ -297,6 +297,21 @@ $_location = $location } + # Handle the HTTPS to HTTP trick for APT-Cacher-NG + if ($ensure == 'present') and ($apt::proxy['https_acng']) { + $__location = $_location.reduce([]) | Array $acng_locations, $loc | { + if $loc =~ /(?i:^https:\/\/)/ { + $patched_location = regsubst($loc, 'https://', 'http://HTTPS///') + } else { + $patched_location = $loc + } + $acng_locations + [$patched_location] + } + } + else { + $__location = $_location + } + if !$release { if fact('os.distro.codename') { $_release = [fact('os.distro.codename')] @@ -332,7 +347,7 @@ 'present': { $header = epp('apt/_header.epp') $source_content = epp('apt/source_deb822.epp', delete_undef_values({ - 'uris' => $_location, + 'uris' => $__location, 'suites' => $_release, 'components' => $_repos, 'types' => $types,