2012-04-30 16:02:19 +00:00
|
|
|
class nginx-debian($version, $max_pool_size = 20) {
|
|
|
|
class { nginx: version => $version, max_pool_size => $max_pool_size }
|
|
|
|
|
2012-02-14 12:11:25 +00:00
|
|
|
$log_root = "/var/log/nginx"
|
|
|
|
|
|
|
|
file { $log_root:
|
|
|
|
owner => root,
|
|
|
|
group => web,
|
2012-02-28 20:07:55 +00:00
|
|
|
mode => 2775,
|
2012-04-25 22:14:41 +00:00
|
|
|
ensure => directory,
|
|
|
|
require => Group['web']
|
2012-02-14 12:11:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
file { "$log_root/sites":
|
|
|
|
owner => root,
|
|
|
|
group => web,
|
|
|
|
mode => 2775,
|
2012-04-25 22:14:41 +00:00
|
|
|
require => [ File[$log_root], Group['web'] ],
|
2012-02-28 20:07:55 +00:00
|
|
|
ensure => directory
|
2012-02-14 12:11:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$pid_file = pid_path('nginx')
|
|
|
|
|
|
|
|
logrotate_d { 'nginx':
|
|
|
|
postrotate => "sudo /bin/kill -USR1 `cat ${pid_file}`",
|
|
|
|
pattern => "/var/log/nginx/*/access.log /var/log/nginx/*/error.log",
|
|
|
|
require => Class['nginx']
|
|
|
|
}
|
2012-04-25 22:14:41 +00:00
|
|
|
|
|
|
|
bash_rc_d { 'nginx':
|
|
|
|
ensure => present,
|
2012-05-01 17:31:36 +00:00
|
|
|
path => $base::local_path,
|
|
|
|
require => Class['nginx']
|
2012-04-25 22:14:41 +00:00
|
|
|
}
|
2012-02-14 12:11:25 +00:00
|
|
|
}
|