lots of updates for debian
This commit is contained in:
parent
d7015e9608
commit
60ffc07d7a
24
shared/additional-modules/nginx-debian/manifests/init.pp
Normal file
24
shared/additional-modules/nginx-debian/manifests/init.pp
Normal file
@ -0,0 +1,24 @@
|
||||
class nginx-debian {
|
||||
$log_root = "/var/log/nginx"
|
||||
|
||||
file { $log_root:
|
||||
owner => root,
|
||||
group => web,
|
||||
mode => 2775
|
||||
}
|
||||
|
||||
file { "$log_root/sites":
|
||||
owner => root,
|
||||
group => web,
|
||||
mode => 2775,
|
||||
require => File[$log_root]
|
||||
}
|
||||
|
||||
$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']
|
||||
}
|
||||
}
|
@ -33,7 +33,7 @@ class nginx($version) {
|
||||
require => Exec['install-passenger']
|
||||
}
|
||||
|
||||
file { [ '/var/log/nginx', $config_path ]:
|
||||
file { $config_path:
|
||||
ensure => directory,
|
||||
before => God_init[$name]
|
||||
}
|
||||
|
@ -43,11 +43,11 @@ God.watch do |w|
|
||||
w.interval = 15.seconds
|
||||
|
||||
w.start = lambda { system("<%= start %>") }
|
||||
w.start_grace = 15.seconds
|
||||
w.start_grace = 10.seconds
|
||||
|
||||
<% if !stop.empty? %>
|
||||
w.stop = lambda { system("<%= stop %>") }
|
||||
w.stop_grace = 15.seconds
|
||||
w.stop_grace = 10.seconds
|
||||
<% end %>
|
||||
|
||||
<% if pid_file %>
|
||||
|
6
shared/modules/logrotate_d/manifests/init.pp
Normal file
6
shared/modules/logrotate_d/manifests/init.pp
Normal file
@ -0,0 +1,6 @@
|
||||
define logrotate_d($postrotate, $pattern) {
|
||||
file { "/etc/logrotate.d/${name}":
|
||||
content => template('logrotate_d/logrotate.d.erb')
|
||||
}
|
||||
}
|
||||
|
12
shared/modules/logrotate_d/templates/logrotate.d.erb
Normal file
12
shared/modules/logrotate_d/templates/logrotate.d.erb
Normal file
@ -0,0 +1,12 @@
|
||||
<%= pattern %> {
|
||||
daily
|
||||
rotate 10000
|
||||
missingok
|
||||
compress
|
||||
delaycompress
|
||||
missingok
|
||||
dateext
|
||||
postrotate
|
||||
<%= postrotate %>
|
||||
endscript
|
||||
}
|
Loading…
Reference in New Issue
Block a user