diff --git a/code/files/logrotate_nginx b/code/files/logrotate_nginx new file mode 100644 index 0000000000000000000000000000000000000000..528f7e3de1943def22128de33b1f8a5b66e2e03a --- /dev/null +++ b/code/files/logrotate_nginx @@ -0,0 +1,12 @@ +/opt/dirac/data/log/nginx/*log { + create 0644 nginx nginx + daily + rotate 10 + missingok + notifempty + compress + sharedscripts + postrotate + /bin/kill -USR1 `cat /opt/rh/nginx16/root/var/run/nginx.pid 2>/dev/null` 2>/dev/null || true + endscript +} diff --git a/code/manifests/init.pp b/code/manifests/init.pp index ba23cefc8c1ef32cc1a5bfc2498d64ea4728639b..b96e49a30554a57b915af4f49dc535d929aec1f2 100644 --- a/code/manifests/init.pp +++ b/code/manifests/init.pp @@ -237,6 +237,15 @@ class dirac ($dirac_user = 'dirac', $dirac_group = 'dirac', content => template($nginx_tpl_path), } + file { '/etc/logrotate.d/nginx16-nginx': + ensure => file, + owner => 'root', + group => 'root', + mode => '0644', + require => Package['nginx16'], + source => 'puppet:///modules/dirac/logrotate_nginx', + } + service { 'nginx16-nginx': ensure => running, require => [Package['nginx16'],