From 12212a762f3c188fef94f763e3a006e49e3a333b Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Mon, 13 Dec 2010 19:40:20 -0500 Subject: 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 --- manifests/apache.pp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'manifests/apache.pp') 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"], + } + } + } } -- cgit v1.2.3