From 9894cf6bd5fc851ae62c855c87324ae3ffbb6643 Mon Sep 17 00:00:00 2001 From: Thomas Bellman <bellman@nsc.liu.se> Date: Thu, 6 Feb 2014 10:04:25 +0100 Subject: [PATCH] Add class for managing the Apache log directory. --- manifests/init.pp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index f9607a5..566e2da 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -14,6 +14,7 @@ class apache { $configfile = '/etc/httpd/conf/httpd.conf' $configdir = '/etc/httpd/conf.d' + $logdir = '/var/log/httpd' } @@ -70,3 +71,26 @@ class apache::service hasstatus => true, hasrestart => true; } } + + + +/* + * Manage the Apache log directory. + * This is mostly intended for those that don't want the defaults. + * By default, it sets ownership and permissions to the same as the + * RedHat packages do. + * To save a little bit of execution time, this is not included by the + * apache::base class, so users need to include it themselves. + */ + +class apache::logdir($owner='root', $group='root', $mode=0700) +{ + include apache + + file { + $apache::logdir: + ensure => directory, + owner => $owner, group => $group, mode => $mode, + require => Package['httpd'], before => Class[apache::service]; + } +} -- GitLab