summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Haerry <haerry@puzzle.ch>2009-06-16 14:20:48 +0200
committerMarcel Haerry <haerry@puzzle.ch>2009-06-16 14:20:48 +0200
commite7e1bd007f4ac5ac324192d6e35da72ee4d6626b (patch)
tree18d129dad614f5c91d91eb466a9515aa2f727840
parent4e97d1e5a61f111beecaa9bc7e366d7ff567a5ef (diff)
introduce usage of mod_macro
-rw-r--r--manifests/mod_macro.pp8
-rw-r--r--manifests/vhost.pp3
-rw-r--r--manifests/vhost/file.pp8
-rw-r--r--manifests/vhost/template.pp2
4 files changed, 19 insertions, 2 deletions
diff --git a/manifests/mod_macro.pp b/manifests/mod_macro.pp
new file mode 100644
index 0000000..acee280
--- /dev/null
+++ b/manifests/mod_macro.pp
@@ -0,0 +1,8 @@
+class apache::mod_macro {
+ include apache
+ package{mod_macro:
+ ensure => installed,
+ require => Package['apache'],
+ notify => Service['apache'],
+ }
+}
diff --git a/manifests/vhost.pp b/manifests/vhost.pp
index 0c7bf7a..cef7fc0 100644
--- a/manifests/vhost.pp
+++ b/manifests/vhost.pp
@@ -35,6 +35,7 @@ define apache::vhost(
$htpasswd_file = 'absent',
$htpasswd_path = 'absent',
$mod_security = true,
+ $use_mod_macro = false,
$ldap_auth = false,
$ldap_user = 'any'
) {
@@ -48,6 +49,7 @@ define apache::vhost(
do_includes => $do_includes,
htpasswd_file => $htpasswd_file,
htpasswd_path => $htpasswd_path,
+ use_mod_macro => $use_mod_macro,
}
}
'template': {
@@ -79,6 +81,7 @@ define apache::vhost(
ldap_auth => $ldap_auth,
ldap_user => $ldap_user,
mod_security => $mod_security,
+ use_mod_macro => $use_mod_macro,
}
}
default: { fail("no such vhost_mode: $vhost_mode defined for $name.") }
diff --git a/manifests/vhost/file.pp b/manifests/vhost/file.pp
index c31420e..bacdca5 100644
--- a/manifests/vhost/file.pp
+++ b/manifests/vhost/file.pp
@@ -14,7 +14,8 @@ define apache::vhost::file(
$content = 'absent',
$do_includes = false,
$htpasswd_file = 'absent',
- $htpasswd_path = 'absent'
+ $htpasswd_path = 'absent',
+ $use_mod_macro = false
){
$vhosts_dir = $operatingsystem ? {
centos => "$apache::centos::config_dir/vhosts.d/",
@@ -36,7 +37,10 @@ define apache::vhost::file(
owner => root, group => 0, mode => 0644;
}
if $do_includes {
- include apache::includes
+ include ::apache::includes
+ }
+ if $use_mod_macro {
+ include ::apache::mod_macro
}
case $content {
'absent': {
diff --git a/manifests/vhost/template.pp b/manifests/vhost/template.pp
index 84e7f33..b8a5c4c 100644
--- a/manifests/vhost/template.pp
+++ b/manifests/vhost/template.pp
@@ -39,6 +39,7 @@ define apache::vhost::template(
$template_mode = 'static',
$ssl_mode = false,
$mod_security = true,
+ $use_mod_macro = false,
$htpasswd_file = 'absent',
$htpasswd_path = 'absent',
$ldap_auth = false,
@@ -109,6 +110,7 @@ define apache::vhost::template(
do_includes => $do_includes,
htpasswd_file => $htpasswd_file,
htpasswd_path => $htpasswd_path,
+ use_mod_macro => $use_mod_macro,
}
}