From 311ce8d3ddafd00543bdbde6b59e3453f88d159f Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 26 Jan 2010 11:08:33 -0200 Subject: Adding proxy support --- manifests/init.pp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'manifests/init.pp') diff --git a/manifests/init.pp b/manifests/init.pp index 7d52135..dcd4b20 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -21,6 +21,16 @@ class apt { default => $apt_update_method, } + $apt_http_proxy = $apt_http_proxy ? { + '' => false, + default => $apt_http_proxy, + } + + $apt_ftp_proxy = $apt_ftp_proxy ? { + '' => false, + default => $apt_ftp_proxy, + } + package { apt: ensure => installed } # a few templates need lsbdistcodename @@ -229,6 +239,20 @@ class apt { } } } + + if $apt_http_proxy or $apt_ftp_proxy { + file { "/etc/apt/apt.conf.d/proxy": + owner => root, + group => root, + mode => 0644, + content => template("apt/proxy.erb"), + require => File[apt_config], + } + } else { + file { "/etc/apt/apt.conf.d/proxy": + ensure => absent, + } + } } class dselect { -- cgit v1.2.3