summaryrefslogtreecommitdiff
path: root/manifests/init.pp
diff options
context:
space:
mode:
authorandreas <andreas@immerda.ch>2008-04-29 07:55:27 +0000
committerandreas <andreas@immerda.ch>2008-04-29 07:55:27 +0000
commit71f32e4139df1c17667a187ebd3ece28635a9a71 (patch)
tree7daa77474795dcc20c2f45cc4d785ed1ae9ed28d /manifests/init.pp
parent43328e80a5508e3ee931a7b10a9ca0667081d232 (diff)
modifications1 for /etc/apache2/modules.d
* own directory * see vhosts.d
Diffstat (limited to 'manifests/init.pp')
-rw-r--r--manifests/init.pp57
1 files changed, 57 insertions, 0 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 32b4610..4850615 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -26,6 +26,15 @@ class apache::base {
require => Package[apache],
}
+ file{'modules_dir':
+ path => '/etc/apache2/modules.d/',
+ ensure => directory,
+ owner => root,
+ group => 0,
+ mode => 0755,
+ require => Package[apache],
+ }
+
package { 'apache':
name => 'apache',
ensure => present,
@@ -69,6 +78,9 @@ class apache::centos inherits apache::base{
File[vhosts_dir]{
path => "$config_dir/vhosts.d/",
}
+ File[modules_dir]{
+ path => "$config_dir/modules.d/",
+ }
file{"${config_dir}/conf.d/ZZZ_vhosts.conf":
source => "puppet://$server/apache/centos/vhosts.conf",
@@ -96,12 +108,16 @@ class apache::gentoo inherits apache::base {
File[vhosts_dir]{
path => "$config_dir/vhosts.d/",
}
+ File[modules_dir]{
+ path => "$config_dir/modules.d/",
+ }
apache::vhost::file { '00_default_ssl_vhost': }
apache::vhost::file { '00_default_vhost': }
apache::config::file { 'default_vhost.include':
source => "apache/vhosts.d/default_vhost.include",
destination => "$config_dir/vhosts.d/default_vhost.include",
}
+ apache::module::file { '00_default_settings': }
}
class apache::debian inherits apache::base {
@@ -120,6 +136,9 @@ class apache::openbsd inherits apache::base {
File[vhosts_dir]{
path => "$config_dir/vhosts.d/",
}
+ File[modules_dir]{
+ path => "$config_dir/modules.d/",
+ }
File[default_apache_index] {
path => '/var/www/htdocs/index.html',
}
@@ -170,6 +189,44 @@ define apache::vhost::file(
}
}
+define apache::module::file(
+ $source = '',
+ $destination = ''
+){
+ $modules_dir = $operatingsystem ? {
+ centos => "$apache::centos::config_dir/modules.d/",
+ gentoo => "$apache::gentoo::config_dir/modules.d/",
+ debian => "$apache::debian::config_dir/modules.d/",
+ ubuntu => "$apache::ubuntu::config_dir/modules.d/",
+ openbsd => "$apache::openbsd::config_dir/modules.d/",
+ default => '/etc/apache2/modules.d/',
+ }
+
+ $real_destination = $destination ? {
+ '' => "${modules_dir}/${name}.conf",
+ default => $destination,
+ }
+
+ $real_source = $source ? {
+ '' => [
+ "puppet://$server/files/apache/modules.d/${fqdn}/${name}.conf",
+ "puppet://$server/files/apache/modules.d/${name}.conf",
+ "puppet://$server/apache/modules.d/${name}.conf"
+ ],
+ default => "puppet://$server/$source",
+ }
+
+ file{"modules_${name}.conf":
+ path => $real_destination,
+ source => $real_source,
+ owner => root,
+ group => 0,
+ mode => 0644,
+ require => [ File[modules_dir], Package[apache] ],
+ notify => Service[apache],
+ }
+}
+
define apache::config::file(
$source = '',
$destination = ''