]> gitweb.fluxo.info Git - puppet-apt.git/commitdiff
parameterize the apt::proxy_client class
authorMicah Anderson <micah@riseup.net>
Wed, 22 Aug 2012 14:55:25 +0000 (10:55 -0400)
committerMicah Anderson <micah@riseup.net>
Wed, 22 Aug 2012 14:55:25 +0000 (10:55 -0400)
manifests/proxy_client.pp
templates/20proxy.erb

index 23e9bd1108b46131a238b45207972458ce68abef..c284c7418e4a74bcd12c335ec4a610dca27541b5 100644 (file)
@@ -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"),
index fd0c7fefee7704b4b721d542a2b81e3d62d7f529..ea706b6ef00896af13eb8f83f19aa750497500ba 100644 (file)
@@ -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";