Skip to content
Snippets Groups Projects
Commit 625d14b5 authored by jurgenhaas's avatar jurgenhaas
Browse files

#2 Logrotate for apache2 inside jails

parent d7f24777
Branches
No related tags found
No related merge requests found
......@@ -107,6 +107,17 @@
with_items: '{{ drupal_settings|default([]) }}'
when: item.jail is defined and (limit_drupal_site is not defined or item.id is not defined or limit_drupal_site == item.id)
- name: "Install logrotate script"
template:
src='etc-logrotate-apache2'
dest='/etc/logrotate.d/apache2-{{ item.jail.name }}'
owner='root'
group='root'
mode=644
with_items: '{{ drupal_settings|default([]) }}'
when: item.jail is defined and (limit_drupal_site is not defined or item.id is not defined or limit_drupal_site == item.id)
tags: 'logrotate'
- name: "Ensure Apache Web Directory"
file:
path='{{ jailroot }}/{{ item.jail.name }}/var/www{{ item.webRoot|default("") }}'
......
{{ jailroot }}/{{ item.jail.name }}/var/log/apache2/*.log {
daily
missingok
rotate 14
compress
delaycompress
notifempty
create 640 root {{ item.jail.name }}
sharedscripts
postrotate
if /etc/init.d/apache2 status > /dev/null ; then \
/etc/init.d/apache2 reload > /dev/null; \
fi;
endscript
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
run-parts /etc/logrotate.d/httpd-prerotate; \
fi; \
endscript
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment