From 4637705ab53ee9689619087bcae1a284fe3ac30e Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 5 Apr 2017 11:10:00 +1000 Subject: [PATCH] Move logrotate to site.pp It's trying to rotate /var/log/planet/planet.log -- it's actually /var/log/planet/openstack.log as specified in the cron entry above. Move the logrotate into the site.pp so it picks up the right ${name} Change-Id: Ic57c8325b3e44890a58273d2bad1e59fbeac682c --- manifests/init.pp | 14 -------------- manifests/site.pp | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 95b1f3c..47f5aa6 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,6 +1,4 @@ class planet { - include ::logrotate - package { 'planet-venus': ensure => present, } @@ -17,18 +15,6 @@ class planet { ensure => directory, } - logrotate::file { "${name}.log": - log => "/var/log/planet/${name}.log", - options => [ - 'compress', - 'copytruncate', - 'missingok', - 'rotate 7', - 'daily', - 'notifempty', - ], - } - } # vim:sw=2:ts=2:expandtab:textwidth=79 diff --git a/manifests/site.pp b/manifests/site.pp index 272ff4c..970b436 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -3,6 +3,7 @@ define planet::site( $vhost_name = "planet.${name}.org" ) { include ::httpd + include ::logrotate ::httpd::vhost { $vhost_name: docroot => "/srv/planet/${name}", @@ -23,6 +24,19 @@ define planet::site( minute => '*/15', user => 'root', } + + logrotate::file { "${name}.log": + log => "/var/log/planet/${name}.log", + options => [ + 'compress', + 'copytruncate', + 'missingok', + 'rotate 7', + 'daily', + 'notifempty', + ], + } + } # vim:sw=2:ts=2:expandtab:textwidth=79