Merge pull request #107 from cloud-hero/master
Added state for configuring logrotate
This commit is contained in:
commit
e10b2f59d1
26
apache/logrotate.sls
Normal file
26
apache/logrotate.sls
Normal file
@ -0,0 +1,26 @@
|
||||
{% from "apache/map.jinja" import apache with context %}
|
||||
|
||||
{{ apache.logrotatedir }}:
|
||||
file:
|
||||
- managed
|
||||
- contents: |
|
||||
{{ apache.logdir }}/*.log {
|
||||
daily
|
||||
missingok
|
||||
rotate 14
|
||||
compress
|
||||
delaycompress
|
||||
notifempty
|
||||
create 640 root adm
|
||||
sharedscripts
|
||||
postrotate
|
||||
if /etc/init.d/{{ apache.service }} status > /dev/null ; then \
|
||||
/etc/init.d/{{ apache.service }} reload > /dev/null; \
|
||||
fi;
|
||||
endscript
|
||||
prerotate
|
||||
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
|
||||
run-parts /etc/logrotate.d/httpd-prerotate; \
|
||||
fi; \
|
||||
endscript
|
||||
}
|
@ -17,6 +17,7 @@
|
||||
'default_site': 'default',
|
||||
'default_site_ssl': 'default-ssl',
|
||||
'logdir': '/var/log/apache2',
|
||||
'logrotatedir': '/etc/logrotate.d/apache2',
|
||||
'wwwdir': '/srv',
|
||||
'use_require': False,
|
||||
},
|
||||
@ -35,6 +36,7 @@
|
||||
'default_site': 'default',
|
||||
'default_site_ssl': 'default-ssl',
|
||||
'logdir': '/var/log/httpd',
|
||||
'logrotatedir': '/etc/logrotate.d/httpd',
|
||||
'wwwdir': '/var/www',
|
||||
'use_require': False,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user