Files
confdroid_nagios/manifests/main/install.pp

71 lines
2.0 KiB
ObjectPascal
Raw Normal View History

2017-07-20 14:47:24 +01:00
## cd_nagios::main::install.pp
# Module name: cd_nagios
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
# # License:
# This file is part of cd_nagios.
#
# cd_nagios is used for providing automatic configuration of Nagios.
# Copyright (C) 2016 ConfDroid (copyright@ConfDroid.com)
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# @summary Class manage all aspects of installing binaries required for
# cd_nagios
###############################################################################
class cd_nagios::main::install (
) inherits cd_nagios::params {
require cd_resources
# if our FQDN matches the configured Nagios server FQDN, install both server-
# and client packages.
if $::fqdn == $ng_nagios_server {
# we'll need httpd installed
require cd_apache
package {$reqpackages_server:
ensure => $pkg_ensure,
}
package {$reqpackages_client:
ensure => $pkg_ensure,
}
# install NRPE if enabled
if $ng_include_nrpe == true {
package {$reqpackages_nrpe:
ensure => $pkg_ensure,
}
}
}
# if we are not the nagios server, install client packages
if $::fqdn != $ng_nagios_server {
package {$reqpackages_client:
ensure => $pkg_ensure,
}
# if we want o use NRPE, install it
if $ng_include_nrpe == true {
package {$reqpackages_nrpe:
ensure => $pkg_ensure,
}
}
}
}