summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2015-10-06 14:32:42 +0200
committervarac <varacanero@zeromail.org>2015-10-06 14:32:42 +0200
commit70afab799b8cf720cd12bd225c1c2948fd1597ee (patch)
tree9cfe2d117de723f519e13908c2a41d09bba6c083
parent6c3ca97f1524e2b6242c27a2c97dbfb78105889f (diff)
parent2cd1b529fc18847712760b15c9412b10d1cee712 (diff)
Merge remote-tracking branch 'shared/master' into leap_master
Conflicts: manifests/apache.pp
-rw-r--r--README8
-rw-r--r--manifests/apache.pp8
-rw-r--r--manifests/debian/apache.pp23
-rw-r--r--manifests/init.pp13
4 files changed, 41 insertions, 11 deletions
diff --git a/README b/README
index cd0d254..4b1864d 100644
--- a/README
+++ b/README
@@ -32,9 +32,9 @@ Monitor
-------
On one node the "nagios" class has to be included. By default this installs
-apache using the "apache" module. To use lighttpd instead, include
-"nagios::lighttpd", or, if the web server is not to be managed by puppet,
-include "nagios::headless".
+apache using the "apache" module. To use lighttpd instead, set the "httpd"
+parameter to the "nagios" class to "lighttpd", or, if the web server is not to
+be managed by puppet, set the "httpd" parameter to "absent".
Hosts
@@ -216,7 +216,7 @@ Usage example:
~~~
node nagios {
- class { 'nagios::apache': } -> class { 'nagios::defaults': }
+ class { 'nagios': } -> class { 'nagios::defaults': }
# Declare another nagios command
nagios::command { http_port:
diff --git a/manifests/apache.pp b/manifests/apache.pp
index f6ec39a..b1da837 100644
--- a/manifests/apache.pp
+++ b/manifests/apache.pp
@@ -5,11 +5,11 @@ class nagios::apache(
$stored_config = true
) {
class{'nagios':
- httpd => 'apache',
+ httpd => 'apache',
allow_external_cmd => $allow_external_cmd,
- manage_munin => $manage_munin,
- manage_shorewall => $manage_shorewall,
- stored_config => $stored_config
+ manage_munin => $manage_munin,
+ manage_shorewall => $manage_shorewall,
+ stored_config => $stored_config
}
case $::operatingsystem {
diff --git a/manifests/debian/apache.pp b/manifests/debian/apache.pp
new file mode 100644
index 0000000..095091e
--- /dev/null
+++ b/manifests/debian/apache.pp
@@ -0,0 +1,23 @@
+# Handle files that are specifically needed for nagios with apache on debian
+#
+# Do not include this class directly. It is included by the nagios class and
+# needs variables from it.
+#
+class nagios::debian::apache {
+
+ include nagios::defaults::vars
+
+ file { "${nagios::defaults::vars::int_cfgdir}/apache2.conf":
+ ensure => present,
+ source => [ "puppet:///modules/site_nagios/configs/${::fqdn}/apache2.conf",
+ 'puppet:///modules/site_nagios/configs/apache2.conf',
+ 'puppet:///modules/nagios/configs/apache2.conf'],
+ }
+
+ apache::config::global { 'nagios3.conf':
+ ensure => link,
+ target => "${nagios::defaults::vars::int_cfgdir}/apache2.conf",
+ require => File["${nagios::defaults::vars::int_cfgdir}/apache2.conf"],
+ }
+
+}
diff --git a/manifests/init.pp b/manifests/init.pp
index 1221950..088286f 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -5,7 +5,7 @@
# Copyright (C) 2007 David Schmitt <david@schmitt.edv-bus.at>
# Copyright 2008, admin(at)immerda.ch
# Copyright 2008, Puzzle ITC GmbH
-# Marcel Härry haerry+puppet(at)puzzle.ch
+# Marcel Haerry haerry+puppet(at)puzzle.ch
# Simon Josi josi+puppet(at)puzzle.ch
#
# This program is free software; you can redistribute
@@ -25,7 +25,12 @@ class nagios(
case $nagios::httpd {
'absent': { }
'lighttpd': { include ::lighttpd }
- 'apache': { include ::apache }
+ 'apache': {
+ include ::apache
+ if $::operatingsystem == 'debian' {
+ include nagios::debian::apache
+ }
+ }
default: { include ::apache }
}
case $::operatingsystem {
@@ -37,7 +42,9 @@ class nagios(
$cfgdir = '/etc/nagios3'
include nagios::debian
}
- default: { fail("No such operatingsystem: ${::operatingsystem} yet defined") }
+ default: {
+ fail("No such operatingsystem: ${::operatingsystem} yet defined")
+ }
}
if $manage_munin {
include nagios::munin