From e1f6d460e00761f93b3e22f4bed6f58d723adac0 Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 16 Aug 2010 22:01:35 +0200 Subject: improve vhosts stuff - move various inclusion to the file define, as this is the last define for all in the chain - only include if our vhost is not set to absent --- manifests/vhost/file.pp | 72 ++++++++++++++++++++++++++------------------- manifests/vhost/template.pp | 4 +-- 2 files changed, 43 insertions(+), 33 deletions(-) (limited to 'manifests') diff --git a/manifests/vhost/file.pp b/manifests/vhost/file.pp index 0c01b34..ae14aeb 100644 --- a/manifests/vhost/file.pp +++ b/manifests/vhost/file.pp @@ -26,6 +26,12 @@ # content and proxies the dynamic calls to the itk setup, that listens only on # the loobpack device (Incompatibility: cannot be used in combination with # 'itk' mode) +# logmode: +# - default: Do normal logging to CustomLog and ErrorLog +# - nologs: Send every logging to /dev/null +# - anonym: Don't log ips for CustomLog, send ErrorLog to /dev/null +# - semianonym: Don't log ips for CustomLog, log normal ErrorLog +# # # mod_security: Whether we use mod_security or not (will include mod_security module) # - false: (*default*) don't activate mod_security @@ -38,42 +44,13 @@ define apache::vhost::file( $content = 'absent', $do_includes = false, $run_mode = 'normal', + $logmode = 'default', $ssl_mode = false, $mod_security = false, $htpasswd_file = 'absent', $htpasswd_path = 'absent', $use_mod_macro = false ){ - if $mod_security { - case $run_mode { - 'itk': { include mod_security::itk } - 'proxy-itk','static-itk': { include mod_security::itk_plus } - default: { include mod_security } - } - } - - case $run_mode { - 'itk': { - include ::apache::itk - include ::apache::itk::lock - if $ssl_mode { - include ::apache::ssl::itk - } - ] - 'proxy-itk','static-itk': { - include ::apache::itk_plus - include ::apache::itk_plus::lock - if $ssl_mode { - include ::apache::ssl::itk_plus - } - } - default: { - include ::apache - if $ssl_mode { - include ::apache::ssl - } - } - } $vhosts_dir = $operatingsystem ? { centos => "$apache::centos::config_dir/vhosts.d", gentoo => "$apache::gentoo::config_dir/vhosts.d", @@ -100,6 +77,41 @@ define apache::vhost::file( include ::apache::mod_macro } if $ensure != 'absent' { + case $logmode { + 'semianonym','anonym': { include apache::noiplog } + } + case $run_mode { + 'itk': { + include ::apache::itk + include ::apache::itk::lock + if $ssl_mode { + include ::apache::ssl::itk + } + if $mod_security { + include mod_security::itk + } + } + 'proxy-itk','static-itk': { + include ::apache::itk_plus + include ::apache::itk_plus::lock + if $ssl_mode { + include ::apache::ssl::itk_plus + } + if $mod_security { + include mod_security::itk_plus + } + } + default: { + include ::apache + if $ssl_mode { + include ::apache::ssl + } + if $mod_security { + include mod_security + } + } + } + case $content { 'absent': { $real_vhost_source = $vhost_source ? { diff --git a/manifests/vhost/template.pp b/manifests/vhost/template.pp index b4c2562..b0c08f9 100644 --- a/manifests/vhost/template.pp +++ b/manifests/vhost/template.pp @@ -166,15 +166,13 @@ define apache::vhost::template( do_includes => $do_includes, run_mode => $run_mode, ssl_mode => $ssl_mode, + logmode => $logmode, mod_security => $mod_security, htpasswd_file => $htpasswd_file, htpasswd_path => $htpasswd_path, use_mod_macro => $use_mod_macro, } if $ensure != 'absent' { - case $logmode { - 'semianonym','anonym': { include apache::noiplog } - } Apache::Vhost::File[$name]{ content => template("apache/vhosts/$template_mode/$operatingsystem.erb") } -- cgit v1.2.3