From b582c48c88511938dbfc0940fd95a8738d1b6ae3 Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 1 Dec 2008 23:10:41 +0000 Subject: added run_mode for running vhosts with the itk module --- manifests/defines/vhost_files.pp | 19 +++++++++++++++++++ manifests/defines/vhost_varieties.pp | 12 ++++++++++++ templates/vhosts/perl/CentOS.erb | 5 +++++ 3 files changed, 36 insertions(+) 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' -%> + + AssignUserId <%= run_uid+" "+run_gid %> + + <%- end -%> /"> AllowOverride <%= allow_override %> <%- unless options.to_s == 'absent' then -%> -- cgit v1.2.3