From 413646a1cb1d57bcbfeffbf00c8bb5f0eb8bcd13 Mon Sep 17 00:00:00 2001 From: Matt Fields Date: Tue, 16 May 2023 13:41:20 -0400 Subject: [PATCH 1/2] Switch to using apt::setting --- manifests/package/apt.pp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/manifests/package/apt.pp b/manifests/package/apt.pp index 6f52848..788bbcf 100644 --- a/manifests/package/apt.pp +++ b/manifests/package/apt.pp @@ -2,13 +2,18 @@ # Uses the puppetlabs-apt module to manage apt package manager proxies # https://forge.puppetlabs.com/puppetlabs/apt class httpproxy::package::apt { + contain apt - class { 'apt': - proxy => { - 'ensure' => $httpproxy::packagemanager::ensure, - 'host' => $httpproxy::http_proxy, - 'port' => $httpproxy::http_proxy_port, - }, + if !defined(Apt::Setting['conf-proxy']) { + $content = @("EOL"/L) + // This file is managed by Puppet. DO NOT EDIT. + Acquire::http::proxy "http://$httpproxy::http_proxy:$httpproxy::http_proxy_port/"; + | EOL + + apt::setting { 'conf-proxy': + ensure => $httpproxy::packagemanager::ensure, + priority => '01', + content => $content, + } } - contain 'apt' } From c34612b637d32e48b0401a7188369a292c85df2f Mon Sep 17 00:00:00 2001 From: Matt Fields Date: Tue, 16 May 2023 13:51:11 -0400 Subject: [PATCH 2/2] Bump apt module version --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 02a331c..9ad8653 100644 --- a/metadata.json +++ b/metadata.json @@ -22,7 +22,7 @@ }, { "name": "puppetlabs/apt", - "version_requirement": ">= 2.2.0 < 9.0.0" + "version_requirement": ">= 2.2.0 < 10.0.0" } ], "operatingsystem_support": [