diff options
author | mh <mh@immerda.ch> | 2010-08-11 14:42:44 +0200 |
---|---|---|
committer | mh <mh@immerda.ch> | 2010-08-11 14:42:44 +0200 |
commit | d275f9db71ffd55aeef9e96b9f923d1169dcaba9 (patch) | |
tree | a93616af827828e7903e43f9bfcb9eca27e0dcc4 /manifests | |
parent | 747054969e709681072426ff2c9ef3446ba7ceb8 (diff) |
only manage source or content if file should be present
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/vhost/file.pp | 4 | ||||
-rw-r--r-- | manifests/vhost/template.pp | 14 |
2 files changed, 11 insertions, 7 deletions
diff --git a/manifests/vhost/file.pp b/manifests/vhost/file.pp index fca0a1e..32a80db 100644 --- a/manifests/vhost/file.pp +++ b/manifests/vhost/file.pp @@ -42,7 +42,8 @@ define apache::vhost::file( if $use_mod_macro { include ::apache::mod_macro } - case $content { + if $ensure != 'absent' { + case $content { 'absent': { $real_vhost_source = $vhost_source ? { 'absent' => [ @@ -66,6 +67,7 @@ define apache::vhost::file( content => $content, } } + } } case $htpasswd_file { 'absent','nodeploy': { info("don't deploy a htpasswd file for ${name}") } diff --git a/manifests/vhost/template.pp b/manifests/vhost/template.pp index c1c9935..d7e9e07 100644 --- a/manifests/vhost/template.pp +++ b/manifests/vhost/template.pp @@ -85,11 +85,6 @@ define apache::vhost::template( 'absent' => "$real_path/logs", default => $logpath } - if $ensure != 'absent' { - case $logmode { - 'semianonym','anonym': { include apache::noiplog } - } - } $servername = $domain ? { 'absent' => $name, @@ -148,11 +143,18 @@ define apache::vhost::template( apache::vhost::file{$name: ensure => $ensure, - content => template("apache/vhosts/$template_mode/$operatingsystem.erb"), do_includes => $do_includes, 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") + } + } } |