diff options
author | Gabriel Filion <lelutin@gmail.com> | 2010-10-17 20:42:09 -0400 |
---|---|---|
committer | Gabriel Filion <lelutin@gmail.com> | 2010-10-17 20:42:09 -0400 |
commit | 8175bff077112fc7b1397f082f1fbac56474feb8 (patch) | |
tree | 327c7cf815ddd772740bc85bea46835b39dc4ef5 /manifests | |
parent | ebcda455df36aefac48bb831192f2b4e7af8fafc (diff) |
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 <lelutin@gmail.com>
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/proxy-client.pp | 18 |
1 files changed, 18 insertions, 0 deletions
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; + } +} |