From 8175bff077112fc7b1397f082f1fbac56474feb8 Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Sun, 17 Oct 2010 20:42:09 -0400 Subject: Add a proxy-client class The module currently doesn't have a handy way of making a server get its packages via a proxy. Add a "proxy-client" class that makes this easy. $apt_proxy declares the proxy server's fqdn $apt_proxy_port declares the port used for connection Signed-off-by: Gabriel Filion --- manifests/proxy-client.pp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 manifests/proxy-client.pp (limited to 'manifests/proxy-client.pp') diff --git a/manifests/proxy-client.pp b/manifests/proxy-client.pp new file mode 100644 index 0000000..ea0a29c --- /dev/null +++ b/manifests/proxy-client.pp @@ -0,0 +1,18 @@ +class apt::proxy-client { + + $real_apt_proxy = $apt_proxy ? { + "" => "localhost", + default => $apt_proxy + } + + $real_apt_proxy_port = $apt_proxy_port ? { + "" => "3142", + default => $apt_proxy_port + } + + file { "/etc/apt/apt.conf.d/20proxy": + ensure => present, + content => "Acquire::http { Proxy \"http://$real_apt_proxy:$real_apt_proxy_port\"; };\n", + owner => root, group => 0, mode => 0644; + } +} -- cgit v1.2.3