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' } 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": [