summaryrefslogtreecommitdiff
path: root/manifests/apache.pp
diff options
context:
space:
mode:
authorGabriel Filion <lelutin@gmail.com>2010-12-13 19:40:20 -0500
committerGabriel Filion <lelutin@gmail.com>2010-12-14 00:22:39 -0500
commit12212a762f3c188fef94f763e3a006e49e3a333b (patch)
tree22ce00f51ef0ba73c3eb3276758ec55f9e1e62f5 /manifests/apache.pp
parent5d5ec8c28d0fe39359af8db159b14faeae397e1f (diff)
Make nagios::apache manage the apache config.
Currently, the nagios module purges all files under the Nagios configuration directory. This has the unwanted effect of removing files that are added by default by the .deb packages, thus making the Nagios interface non functional under apache. To fix the situation, make nagios::apache under Debian manage the apache config file and link to it in apache's conf.d directory, in the same manner as the Debian packages do. Signed-off-by: Gabriel Filion <lelutin@gmail.com>
Diffstat (limited to 'manifests/apache.pp')
-rw-r--r--manifests/apache.pp17
1 files changed, 17 insertions, 0 deletions
diff --git a/manifests/apache.pp b/manifests/apache.pp
index 36994f8..a91fee9 100644
--- a/manifests/apache.pp
+++ b/manifests/apache.pp
@@ -1,4 +1,21 @@
class nagios::apache {
$nagios_httpd = 'apache'
include nagios
+
+ case $operatingsystem {
+ 'debian': {
+ file { "${nagios::nagios_cfgdir}/apache2.conf":
+ ensure => present,
+ source => ["puppet:///site-nagios/configs/${fqdn}/apache2.conf",
+ "puppet:///site-nagios/configs/apache2.conf",
+ "puppet:///nagios/configs/apache2.conf"],
+ }
+
+ apache::config::global { "nagios3.conf":
+ ensure => link,
+ target => "${nagios::nagios_cfgdir}/apache2.conf",
+ require => File["${nagios::nagios_cfgdir}/apache2.conf"],
+ }
+ }
+ }
}