diff --git a/README.md b/README.md index 3e8f82d..fce6f82 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ The module has only been tested on [CentOS 6.5](http://www.centos.org/download/) Currently, this module does not install or configure any web UIs for Icinga 2. This module also does not install or configure a mail transfer agent (MTA) to send outgoing alert emails. -While NRPE is required for Icinga 2 to check non-network-reachble things on client machines (CPU, load average, etc.), this module itself doesn't have any dependencies between the server component (the `icinga2::server` class) and client component (the `icinga2::client` class). Either one can be used independently of the other. +While NRPE is required for Icinga 2 to check non-network-reachble things on client machines (CPU, load average, etc.), this module itself doesn't have any dependencies between the server component (the `icinga2::server` class) and client component (the `icinga2::nrpe` class). Either one can be used independently of the other. ###Requirements @@ -82,12 +82,38 @@ class { 'icinga2::server': } +**Note:** If you will be installing NRPE or the Nagios plugins packages with the `icinga2::client` class on a node that also has the `icinga2::server` class applied, be sure to set the `$server_install_nagios_plugins` parameter in your call to `icinga2::server` to `false`: + +
+#Install Icinga 2: +class { 'icinga2::server': + ... + server_install_nagios_plugins => false, + ... + } ++ +This will stop the `icinga2::server` class from trying to install the plugins pacakges, since the `icinga2::client` class will already be installing them and will prevent a resulting duplicate resource error. + + ####Client usage To install NRPE and allow the local machine and Icinga 2 servers (or Icinga 1 or plain old Nagios servers) with various IP addresess to connect:
-class { 'icinga2::client': +class { 'icinga2::nrpe': nrpe_allowed_hosts => ['10.0.1.79', '10.0.1.80', '10.0.1.85', '127.0.0.1'], } -\ No newline at end of file + + +**Note:** If you would like to install NRPE on a node that also has the `icinga2::server` class applied, be sure to set the `$server_install_nagios_plugins` parameter in your call to `icinga2::server` to `false`: + +
+#Install Icinga 2: +class { 'icinga2::server': + server_db_type => 'pgsql', + server_install_nagios_plugins => false, + } ++ +This will stop the `icinga2::server` class from trying to install the plugins pacakges, since the `icinga2::client` class will already be installing them and will prevent a resulting duplicate resource error. \ No newline at end of file diff --git a/manifests/params.pp b/manifests/params.pp index 46265f0..4b5707a 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -48,6 +48,9 @@ class icinga2::params { $db_password = 'password' $db_host = 'localhost' + #Whether to install the plugin packages when the icinga2::server class is applied: + $server_install_nagios_plugins = 'true' + ############################## # Icinga 2 server package parameters diff --git a/manifests/server.pp b/manifests/server.pp index 05fa711..cd731c3 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -21,6 +21,7 @@ class icinga2::server ( $package_provider = $icinga2::params::package_provider, $icinga2_server_package = $icinga2::params::icinga2_server_package, #$server_db_schema_path = $icinga2::params::server_db_schema_path + $server_install_nagios_plugins = $icinga2::params::server_install_nagios_plugins, ) inherits icinga2::params { #Pick set the right path where we can find the DB schema based on the OS... diff --git a/manifests/server/install.pp b/manifests/server/install.pp index e4e84fd..22ee84c 100644 --- a/manifests/server/install.pp +++ b/manifests/server/install.pp @@ -75,10 +75,12 @@ class icinga2::server::install::packages inherits icinga2::server { provider => $package_provider, } - #Install the Nagios plugins packages: - package {$icinga2_server_plugin_packages: - ensure => installed, - provider => $package_provider, + if $server_install_nagios_plugins == true { + #Install the Nagios plugins packages: + package {$icinga2_server_plugin_packages: + ensure => installed, + provider => $package_provider, + } } #Pick the right DB lib package name based on the database type the user selected: