From: Dan Bode Date: Wed, 8 Feb 2012 17:40:43 +0000 (-0800) Subject: (#12529) Add parameter to support setting a proxy for apt X-Git-Tag: 0.0.1~13^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=50f3cca0c67abad7168e852b58992afbdc8920bc;p=puppet-modules%2Fpuppetlabs-apt.git (#12529) Add parameter to support setting a proxy for apt This commit adds two class parameter to apt that can be used to specify a proxy to use with apt. - proxy_host - proxy_port --- diff --git a/manifests/init.pp b/manifests/init.pp index 59a56e3..8d266b8 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -16,7 +16,9 @@ # class { 'apt': } class apt( $disable_keys = false, - $always_apt_update = false + $always_apt_update = false, + $proxy_host = false, + $proxy_port = '8080' ) { include apt::params @@ -54,4 +56,11 @@ class apt( creates => '/etc/apt/apt.conf.d/99unauth' } } + + if($proxy_host) { + file { 'configure-apt-proxy': + path => '/etc/apt/apt.conf.d/proxy', + content => "Acquire::http::Proxy \"http://${proxy_host}:${proxy_port}\";", + } + } } diff --git a/manifests/source.pp b/manifests/source.pp index ddf753a..2bd2e42 100644 --- a/manifests/source.pp +++ b/manifests/source.pp @@ -15,7 +15,6 @@ define apt::source( include apt::params - file { "${name}.list": path => "${apt::params::root}/sources.list.d/${name}.list", ensure => file, @@ -23,6 +22,7 @@ define apt::source( group => root, mode => 644, content => template("apt/source.list.erb"), + } if $pin != false {