(#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
This commit is contained in:
Dan Bode 2012-02-08 09:40:43 -08:00
parent 0d32fee292
commit 50f3cca0c6
2 changed files with 11 additions and 2 deletions

View file

@ -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}\";",
}
}
}

View file

@ -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 {