summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2008-12-01 23:10:41 +0000
committermh <mh@immerda.ch>2008-12-01 23:10:41 +0000
commitb582c48c88511938dbfc0940fd95a8738d1b6ae3 (patch)
tree17af97d058c2633a8cd847488b52ad46f6aeafc8
parent6961426625a495b26066f90a786480a0b2233259 (diff)
added run_mode for running vhosts with the itk module
-rw-r--r--manifests/defines/vhost_files.pp19
-rw-r--r--manifests/defines/vhost_varieties.pp12
-rw-r--r--templates/vhosts/perl/CentOS.erb5
3 files changed, 36 insertions, 0 deletions
diff --git a/manifests/defines/vhost_files.pp b/manifests/defines/vhost_files.pp
index 844166e..207c4fa 100644
--- a/manifests/defines/vhost_files.pp
+++ b/manifests/defines/vhost_files.pp
@@ -26,6 +26,9 @@ define apache::vhost(
$cgi_binpath = 'absent',
$options = 'absent',
$additional_options = 'absent',
+ $run_mode = 'normal',
+ $run_uid = 'absent',
+ $run_gid = 'absent',
$template_mode = 'static',
$ssl_mode = 'false',
$htpasswd_file = 'absent',
@@ -53,6 +56,9 @@ define apache::vhost(
allow_override => $allow_override,
options => $options,
additional_options => $additional_options,
+ run_mode => $run_mode,
+ run_uid => $run_uid,
+ run_gid => $run_gid,
template_mode => $template_mode,
ssl_mode => $ssl_mode,
htpasswd_file => $htpasswd_file,
@@ -167,6 +173,9 @@ define apache::vhost::template(
$cgi_binpath = 'absent',
$options = 'absent',
$additional_options = 'absent',
+ $run_mode = 'normal',
+ $run_uid = 'absent',
+ $run_gid = 'absent',
$template_mode = 'static',
$ssl_mode = 'false',
$mod_security = 'true',
@@ -204,6 +213,16 @@ define apache::vhost::template(
}
default: { $real_htpasswd_path = $htpasswd_path }
}
+ case $run_mode {
+ 'itk': {
+ case $run_uid {
+ 'absent': { fail("you have to define run_uid for $name on $fqdn") }
+ }
+ case $run_gid {
+ 'absent': { fail("you have to define run_gid for $name on $fqdn") }
+ }
+ }
+ }
apache::vhost::file{$name:
content => template("apache/vhosts/$template_mode/$operatingsystem.erb"),
htpasswd_file => $htpasswd_file,
diff --git a/manifests/defines/vhost_varieties.pp b/manifests/defines/vhost_varieties.pp
index 3f3121c..2b5cd44 100644
--- a/manifests/defines/vhost_varieties.pp
+++ b/manifests/defines/vhost_varieties.pp
@@ -143,6 +143,12 @@ define apache::vhost::php::standard(
}
}
+# run_mode:
+# - normal: nothing special (*default*)
+# - itk: apache is running with the itk module
+# and run_uid and run_gid are used as vhost users
+# run_uid: the uid the vhost should run as with the itk module
+# run_gid: the gid the vhost should run as with the itk module
define apache::vhost::perl(
$domain = 'absent',
$domainalias = 'absent',
@@ -152,6 +158,9 @@ define apache::vhost::perl(
$documentroot_owner = apache,
$documentroot_group = 0,
$documentroot_mode = 0750,
+ $run_mode = 'normal',
+ $run_uid = 'absent',
+ $run_gid = 'absent',
$allow_override = 'None',
$cgi_binpath = 'absent',
$options = 'absent',
@@ -194,6 +203,9 @@ define apache::vhost::perl(
vhost_destination => $vhost_destination,
domain => $domain,
domainalias => $domainalias,
+ run_mode => $run_mode,
+ run_uid => $run_uid,
+ run_gid => $run_gid,
allow_override => $allow_override,
options => $options,
additional_options => $additional_options,
diff --git a/templates/vhosts/perl/CentOS.erb b/templates/vhosts/perl/CentOS.erb
index 9c9e1f7..2dce115 100644
--- a/templates/vhosts/perl/CentOS.erb
+++ b/templates/vhosts/perl/CentOS.erb
@@ -10,6 +10,11 @@
ErrorLog <%= logdir %>/error_log
CustomLog <%= logdir %>/access_log combined
+ <%- if run_mode.to_s == 'itk' -%>
+ <IfModule mpm_itk_module>
+ AssignUserId <%= run_uid+" "+run_gid %>
+ </IfModule>
+ <%- end -%>
<Directory "<%= documentroot %>/">
AllowOverride <%= allow_override %>
<%- unless options.to_s == 'absent' then -%>