# Example: # debproxy::activateclient { dist: # debproxyhost => "debproxy-ubuntu", # } define debproxy::activateclient ( $debproxyhost ) { file { "/etc/apt/apt.conf.d/01proxy": ensure => "present", content => "Acquire::http { Proxy \"http://$debproxyhost:3142\"; };\n", } } class debproxy::server { package { "apt-cacher": ensure => installed } file { "/etc/default/apt-cacher": ensure => present, checksum => mtime } line { aptcacher_off: file => "/etc/default/apt-cacher", line => 'AUTOSTART=0', ensure => absent, require => Package["apt-cacher"] } line { aptcacher_on: file => "/etc/default/apt-cacher", line => 'AUTOSTART=1', ensure => present, require => Package["apt-cacher"] } service { "apt-cacher": ensure => running, subscribe => [ Package["apt-cacher"], file["/etc/default/apt-cacher"]] } }