clean up varnish config

This commit is contained in:
John Bintz 2012-05-14 11:07:28 -04:00
parent 3d37477eb5
commit 171b4d3546
2 changed files with 23 additions and 10 deletions

View File

@ -1,21 +1,34 @@
class varnish::debian($version, $vcl_template) { class varnish::debian($version, $vcl_template, $store_file_mb = 1024) {
$user = 'varnish' $varnish_user = 'varnish'
$group = 'varnish' $varnish_group = 'varnish'
user { $user: uid => 27835 } user { $varnish_user: uid => 27835 }
package { 'libpcre3-dev': ensure => installed } $packages = [ 'libpcre3', 'libpcre3-dev', 'pkg-config' ]
package { $packages: ensure => installed }
class { 'varnish': class { 'varnish':
version => $version, version => $version,
require => Package['libpcre3-dev'], require => Package[$packages],
vcl_template => $vcl_template vcl_template => $vcl_template
} }
init_d { 'varnish': init_d_bundle { 'varnish':
init_d_prerun => template('varnish/debian/init-d-prerun'),
init_d_prolog => template('varnish/debian/init-d-prolog'), init_d_prolog => template('varnish/debian/init-d-prolog'),
init_d_prerun => template('varnish/debian/init-d-prerun'),
require => Class['varnish'] require => Class['varnish']
} }
exec { 'ensure-data-store-ownership':
command => "chown -R ${varnish_user}:${varnish_group} ${varnish::data}",
path => $base::path,
require => Class['varnish']
}
logrotate_d { 'varnishncsa':
postrotate => 'service varnish rotate',
pattern => "${varnish::log}/access.log"
}
} }

View File

@ -4,5 +4,5 @@ ulimit -n ${NFILES:-131072}
# Maxiumum locked memory size for shared memory log # Maxiumum locked memory size for shared memory log
ulimit -l ${MEMLOCK:-82000} ulimit -l ${MEMLOCK:-82000}
USER=<%= user %> USER=<%= varnish_user %>
GROUP=<%= group %> GROUP=<%= varnish_group %>