summaryrefslogtreecommitdiff
path: root/manifests/vhost
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2011-04-01 00:19:19 +0200
committermh <mh@immerda.ch>2011-04-01 00:19:19 +0200
commite137ede80153dbd0dd2f9213e77c40512f59a86e (patch)
tree1067d840606a110a7250ef696781fdcca33ee5a2 /manifests/vhost
parent7f254be7d55f2208f3ea7e2fe6d40284f92e04c8 (diff)
fixing path
Diffstat (limited to 'manifests/vhost')
-rw-r--r--manifests/vhost/passenger.pp22
1 files changed, 14 insertions, 8 deletions
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,