Handle munin_allow and nagios_allow variables as arrays

This commit is contained in:
Ossi Salmi 2013-06-14 01:52:27 +03:00
parent e13e510b6e
commit c8be8b86af
3 changed files with 17 additions and 4 deletions

View file

@ -179,10 +179,15 @@ define nagios::target::tcp($port, $description=undef) {
# Configure nagios nrpe target.
#
# === Global variables
#
# $nagios_allow:
# Array of IP addresses allowed to connect to the nrpe service.
#
class nagios::target::nrpe inherits nagios::target {
if !$nagios_allow {
$nagios_allow = "127.0.0.1"
$nagios_allow = [ "127.0.0.1" ]
}
include nagios::common
@ -248,7 +253,7 @@ class nagios::target::nrpe inherits nagios::target {
"openbsd" => "wheel",
default => "root",
},
content => "allowed_hosts=${nagios_allow}\n",
content => inline_template("allowed_hosts=<%= @nagios_allow.join(',') %>\n"),
require => File["/etc/nrpe.d"],
notify => Service["nrpe"],
}