diff options
-rw-r--r-- | files/OpenBSD/bin/apache_logrotate.sh | 6 | ||||
-rw-r--r-- | files/OpenBSD/bin/restart_apache.sh (renamed from files/openbsd/bin/restart_apache.sh) | 0 | ||||
-rw-r--r-- | files/OpenBSD/bin/restart_apache_ssl.sh (renamed from files/openbsd/bin/restart_apache_ssl.sh) | 0 | ||||
-rw-r--r-- | manifests/init.pp | 19 | ||||
-rw-r--r-- | manifests/ssl.pp | 2 |
5 files changed, 25 insertions, 2 deletions
diff --git a/files/OpenBSD/bin/apache_logrotate.sh b/files/OpenBSD/bin/apache_logrotate.sh new file mode 100644 index 0000000..c8614f8 --- /dev/null +++ b/files/OpenBSD/bin/apache_logrotate.sh @@ -0,0 +1,6 @@ +#!/bin/sh +WEBROOT="/var/www/htdocs" +#PIDFILE="/var/www/logs/httpd.pid" +echo "#Autogenrated newsyslog.conf\n# logfile_name owner:group mode count size when flags" +find $WEBROOT -name '*_log' -exec perl -e 'print "\n{}\twww:www\t644\t30\t*\t\$D0\tZ" ' \; +perl -e 'print "\t\t \"/bin/sh /opt/bin/restart_apache.sh\"";' diff --git a/files/openbsd/bin/restart_apache.sh b/files/OpenBSD/bin/restart_apache.sh index 4dc936d..4dc936d 100644 --- a/files/openbsd/bin/restart_apache.sh +++ b/files/OpenBSD/bin/restart_apache.sh diff --git a/files/openbsd/bin/restart_apache_ssl.sh b/files/OpenBSD/bin/restart_apache_ssl.sh index 314018b..314018b 100644 --- a/files/openbsd/bin/restart_apache_ssl.sh +++ b/files/OpenBSD/bin/restart_apache_ssl.sh diff --git a/manifests/init.pp b/manifests/init.pp index 55caf49..b66be3d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -201,7 +201,7 @@ class apache::openbsd inherits apache::base { file{'/opt/bin/restart_apache.sh': - source => "puppet://$server/apache/openbsd/bin/restart_apache.sh", + source => "puppet://$server/apache/OpenBSD/bin/restart_apache.sh", require => File['/opt/bin'], owner => root, group => 0, mode => 0700; } @@ -214,4 +214,21 @@ class apache::openbsd inherits apache::base { start => 'apachectl start', stop => 'apachectl stop', } + + file{'/opt/bin/apache_logrotate.sh': + source => "puppet://$server/apache/OpenBSD/bin/apache_logrotate.sh", + require => File['/opt/bin'], + owner => root, group => 0, mode => 0700; + } + + cron { 'update_apache_logrotation': + command => '/bin/sh /opt/bin/apache_logrotate.sh > /etc/newsyslog_apache.conf', + minute => '1', + hour => '1', + } + cron { 'run_apache_logrotation': + command => '/usr/bin/newsyslog -f /etc/newsyslog_apache.conf > /dev/null', + minute => '10', + } + } diff --git a/manifests/ssl.pp b/manifests/ssl.pp index 778fbbc..a67ea90 100644 --- a/manifests/ssl.pp +++ b/manifests/ssl.pp @@ -40,7 +40,7 @@ class apache::ssl::openbsd inherits apache::openbsd { } File['/opt/bin/restart_apache.sh']{ - source => "puppet://$server/apache/openbsd/bin/restart_apache_ssl.sh", + source => "puppet://$server/apache/OpenBSD/bin/restart_apache_ssl.sh", } Service['apache']{ start => 'apachectl startssl', |