From b528cd0005f263b3d2014cdc44d7461577821343 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Wed, 22 Aug 2012 10:55:25 -0400 Subject: parameterize the apt::proxy_client class --- manifests/proxy_client.pp | 15 ++++----------- templates/20proxy.erb | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/manifests/proxy_client.pp b/manifests/proxy_client.pp index 23e9bd1..c284c74 100644 --- a/manifests/proxy_client.pp +++ b/manifests/proxy_client.pp @@ -1,14 +1,7 @@ -class apt::proxy_client { - - $real_apt_proxy = $apt_proxy ? { - "" => "http://localhost", - default => $apt_proxy - } - - $real_apt_proxy_port = $apt_proxy_port ? { - "" => "3142", - default => $apt_proxy_port - } +class apt::proxy_client( + $proxy = 'http://localhost', + $port = '3142', +){ apt_conf { "20proxy": content => template("apt/20proxy.erb"), diff --git a/templates/20proxy.erb b/templates/20proxy.erb index fd0c7fe..ea706b6 100644 --- a/templates/20proxy.erb +++ b/templates/20proxy.erb @@ -1,5 +1,5 @@ // This file is managed by Puppet // all local modifications will be overwritten -Acquire::http { Proxy "<%= real_apt_proxy %>:<%= real_apt_proxy_port %>"; }; +Acquire::http { Proxy "<%= proxy %>:<%= port %>"; }; Acquire::HTTP::Proxy::bugs.debian.org "DIRECT"; -- cgit v1.2.3