From e137ede80153dbd0dd2f9213e77c40512f59a86e Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 1 Apr 2011 00:19:19 +0200 Subject: fixing path --- manifests/vhost/passenger.pp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'manifests/vhost') diff --git a/manifests/vhost/passenger.pp b/manifests/vhost/passenger.pp index 5649fb0..980c6a4 100644 --- a/manifests/vhost/passenger.pp +++ b/manifests/vhost/passenger.pp @@ -66,28 +66,34 @@ define apache::vhost::passenger( documentroot_mode => $documentroot_mode, } } - + $real_path = $path ? { + 'absent' => $operatingsystem ? { + openbsd => "/var/www/htdocs/${name}", + default => "/var/www/vhosts/${name}" + }, + default => "${path}" + } file{ - ["${path}/www/tmp", "${path}/www/logs"]: + ["${real_path}/www/tmp", "${real_path}/www/logs"]: ensure => directory, owner => $documentroot_owner, group => $run_gid, mode => 0660; - ["${path}/www/public", "${path}/gems"]: + ["${real_path}/www/public", "${real_path}/gems"]: ensure => directory, owner => $documentroot_owner, group => $run_gid, mode => 0640; } if $passenger_app == 'rails' { file{ - "${path}/www/config": + "${real_path}/www/config": ensure => directory, owner => $documentroot_owner, group => $run_gid, mode => 0640; - "${path}/www/config/environment.rb": + "${real_path}/www/config/environment.rb": ensure => present, owner => $run_uid, group => $run_gid, mode => 0660; } } else { #rack based file{ - "${path}/www/config.ru": + "${real_path}/www/config.ru": ensure => present, owner => $run_uid, group => $run_gid, mode => 0660; } @@ -96,12 +102,12 @@ define apache::vhost::passenger( # create vhost configuration file ::apache::vhost{$name: ensure => $ensure, - path => "${path}/www/public", + path => "${real_path}/www/public", path_is_webdir => true, template_mode => $template_mode, template_partial => 'apache/vhosts/passenger/partial.erb', logmode => $logmode, - logpath => "${path}/logs", + logpath => "${real_path}/logs", vhost_mode => $vhost_mode, vhost_source => $vhost_source, vhost_destination => $vhost_destination, -- cgit v1.2.3