squidddddd
This commit is contained in:
parent
a3dcdbcece
commit
0f0a081177
@ -23,10 +23,5 @@ class squid::debian($version, $config_template, $error_template) {
|
||||
path => $base::path,
|
||||
require => Class['squid']
|
||||
}
|
||||
|
||||
logrotate_d { 'squid':
|
||||
postrotate => 'service squid rotate',
|
||||
pattern => "${squid::log_dir}/access.log"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,10 +14,17 @@ class squid($version = '', $user = 'proxy', $group = 'proxy', $config_template,
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
logrotate_d { 'squid3':
|
||||
postrotate => 'god signal squid HUP',
|
||||
pattern => "${log_dir}/access.log"
|
||||
}
|
||||
} else {
|
||||
$bin = bin_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] -> Exec[cache_dir_perms]
|
||||
}
|
||||
|
||||
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]
|
||||
}
|
||||
|
||||
exec { cache_dir_perms:
|
||||
exec { 'cache_dir_perms':
|
||||
command => "chown -R ${user}:${group} ${cache_dir}",
|
||||
path => $::base::path,
|
||||
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,
|
||||
require => Exec[cache_dir_perms]
|
||||
require => Exec['squid-cache']
|
||||
}
|
||||
|
||||
file { $config:
|
||||
|
@ -3,7 +3,6 @@
|
||||
rotate 10000
|
||||
missingok
|
||||
compress
|
||||
delaycompress
|
||||
missingok
|
||||
dateext
|
||||
postrotate
|
||||
|
Loading…
Reference in New Issue
Block a user