diff options
author | Micah <micah@riseup.net> | 2015-10-05 23:16:03 +0000 |
---|---|---|
committer | Micah <micah@riseup.net> | 2015-10-05 23:16:03 +0000 |
commit | 2cd1b529fc18847712760b15c9412b10d1cee712 (patch) | |
tree | 5acf3f805be3da4c7094cf364f345630ec1e06dc /manifests | |
parent | 63b80c9c238b19635665cfe20c2c8bd79994ab15 (diff) | |
parent | 93a00004cfea3e8a4c85d1bbdaaaac5e5ced118f (diff) |
Merge branch 'fix_apache' into 'master'
Fix apache
the main class is currently unusable with apache, which is the default case.
we need to move management of files necessary for nagios+apache+debian into the "nagios" class to fix this.
This partly responds to #4
See merge request !12
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/apache.pp | 23 | ||||
-rw-r--r-- | manifests/debian/apache.pp | 23 | ||||
-rw-r--r-- | manifests/init.pp | 11 |
3 files changed, 35 insertions, 22 deletions
diff --git a/manifests/apache.pp b/manifests/apache.pp index b89ff5d..1e4224e 100644 --- a/manifests/apache.pp +++ b/manifests/apache.pp @@ -4,26 +4,9 @@ class nagios::apache( $manage_munin = false ) { class{'nagios': - httpd => 'apache', + httpd => 'apache', allow_external_cmd => $allow_external_cmd, - manage_munin => $manage_munin, - manage_shorewall => $manage_shorewall, - } - - case $::operatingsystem { - 'debian': { - 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"], - } - } + manage_munin => $manage_munin, + manage_shorewall => $manage_shorewall, } } 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 c62c480..c800637 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -24,7 +24,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 { @@ -36,7 +41,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 |