squidddddd

This commit is contained in:
John Bintz 2012-07-20 14:43:07 -04:00
parent a3dcdbcece
commit 0f0a081177
3 changed files with 20 additions and 10 deletions

View File

@ -23,10 +23,5 @@ class squid::debian($version, $config_template, $error_template) {
path => $base::path, path => $base::path,
require => Class['squid'] require => Class['squid']
} }
logrotate_d { 'squid':
postrotate => 'service squid rotate',
pattern => "${squid::log_dir}/access.log"
}
} }

View File

@ -14,10 +14,17 @@ class squid($version = '', $user = 'proxy', $group = 'proxy', $config_template,
} }
Package['squid3'] -> File[$config] Package['squid3'] -> File[$config]
Package['squid3'] -> Exec['stop-squid-for-good'] -> Exec['squid-cache']
exec { 'update-rc.d -f squid3 remove': exec { 'stop-squid-for-good':
command => 'service squid3 stop ; update-rc.d -f squid3 remove',
path => $::base::path path => $::base::path
} }
logrotate_d { 'squid3':
postrotate => 'god signal squid HUP',
pattern => "${log_dir}/access.log"
}
} else { } else {
$bin = bin_path($name) $bin = bin_path($name)
$sbin = sbin_path($name) $sbin = sbin_path($name)
@ -37,6 +44,7 @@ class squid($version = '', $user = 'proxy', $group = 'proxy', $config_template,
} }
Build_and_install[$name] -> File[$config] Build_and_install[$name] -> File[$config]
Build_and_install[$name] -> Exec[cache_dir_perms]
} }
mkdir_p { [ $log_dir, $cache_dir, $config_dir ]: mkdir_p { [ $log_dir, $cache_dir, $config_dir ]:
@ -48,15 +56,23 @@ class squid($version = '', $user = 'proxy', $group = 'proxy', $config_template,
require => Mkdir_p[$log_dir] require => Mkdir_p[$log_dir]
} }
exec { cache_dir_perms: exec { 'cache_dir_perms':
command => "chown -R ${user}:${group} ${cache_dir}", command => "chown -R ${user}:${group} ${cache_dir}",
path => $::base::path, path => $::base::path,
require => Mkdir_p[$cache_dir] require => Mkdir_p[$cache_dir]
} }
exec { "${sbin}/squid3 -z": exec { 'squid-cache':
command => "${sbin}/squid3 -z",
logoutput => true,
require => Exec['cache_dir_perms'],
path => $::base::path
}
exec { 'cache_dir_perms_again':
command => "chown -R ${user}:${group} ${cache_dir}",
path => $::base::path, path => $::base::path,
require => Exec[cache_dir_perms] require => Exec['squid-cache']
} }
file { $config: file { $config:

View File

@ -3,7 +3,6 @@
rotate 10000 rotate 10000
missingok missingok
compress compress
delaycompress
missingok missingok
dateext dateext
postrotate postrotate