summaryrefslogtreecommitdiff
path: root/manifests/init.pp
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2008-02-28 10:46:09 +0000
committermh <mh@immerda.ch>2008-02-28 10:46:09 +0000
commit1eac015e7267eeec3d05b2e2aff24dffa2877f6c (patch)
tree3664d24d5f30c2e0c16184151010f23cb9daf09c /manifests/init.pp
parent2538f0f1eceaf4cf74e6245b3bcfd5ecee4d6f46 (diff)
improved apache module
Diffstat (limited to 'manifests/init.pp')
-rw-r--r--manifests/init.pp33
1 files changed, 28 insertions, 5 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 8c12522..c08c5d5 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -105,7 +105,10 @@ define apache::vhost::file(
}
$real_source = $source ? {
- '' => "dist/apache2/vhosts.d/${fqdn}/${name}.conf",
+ '' => [
+ "apache2/vhosts.d/${fqdn}/${name}.conf",
+ "dist/apache2/vhosts.d/${fqdn}/${name}.conf"
+ ],
default => $source,
}
@@ -125,16 +128,36 @@ define apache::config::file(
$destination = ''
){
$real_source = $source ? {
- '' => "dist/apache2/conf/${fqdn}/${name}",
+ # get a whole bunch of possible sources if there is no specific source for that config-file
+ '' => [
+ "apache2/conf/${fqdn}/${name}",
+ "dist/apache2/conf/${fqdn}/${name}"
+ "apache2/conf/common/${name}.${operatingsystem}.${lsbdistcodename}",
+ "apache2/conf/common/${name}.${operatingsystem}",
+ "apache2/conf/common/${name}.Default"
+ ],
default => $source,
}
$real_destination = $destination ? {
'' => $operatingsystem ? {
- centos => "/etc/httpd/vhosts.d/${name}.conf",
- openbsd => "/var/www/conf/vhosts.d/${name}.conf",
- default => "/etc/apache2/vhosts.d/${name}.conf",
+ centos => "$apache::centos::config_dir/${name}",
+ gentoo => "$apache::gentoo::config_dir/${name}",
+ debian => "$apache::debian::config_dir/${name}",
+ ubuntu => "$apache::ubuntu::config_dir/${name}",
+ openbsd => "$apache::openbsd::config_dir/${name}",
+ default => "/etc/apache2/${name}",
},
default => $destination
}
+
+ file{"apache_${name}":
+ path => $real_destination,
+ source => "puppet://$server/$real_source",
+ owner => root,
+ group => 0,
+ mode => 0644,
+ require => Class[apache],
+ notify => Service[apache],
+ }
}