From b67bdf5441bbd3fe0bd399623c779ab6c3dc22a9 Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Sun, 21 Feb 2010 15:11:33 +0000 Subject: [PATCH] template the munin master as well Signed-off-by: Stephen Gran --- modules/munin-node/manifests/init.pp | 3 +-- .../munin-node.conf.erb} | 13 +++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) rename modules/munin-node/{files/common/munin-node.conf => templates/munin-node.conf.erb} (80%) diff --git a/modules/munin-node/manifests/init.pp b/modules/munin-node/manifests/init.pp index 5ddbf6eb..ac999ef9 100644 --- a/modules/munin-node/manifests/init.pp +++ b/modules/munin-node/manifests/init.pp @@ -60,8 +60,7 @@ class munin-node { file { "/etc/munin/munin-node.conf": - source => [ "puppet:///munin-node/per-host/$fqdn/munin-node.conf", - "puppet:///munin-node/common/munin-node.conf" ], + content => template("munin-node/munin-node.conf.erb"), require => Package["munin-node"], notify => Exec["munin-node restart"]; diff --git a/modules/munin-node/files/common/munin-node.conf b/modules/munin-node/templates/munin-node.conf.erb similarity index 80% rename from modules/munin-node/files/common/munin-node.conf rename to modules/munin-node/templates/munin-node.conf.erb index 84906d4c..070adb06 100644 --- a/modules/munin-node/files/common/munin-node.conf +++ b/modules/munin-node/templates/munin-node.conf.erb @@ -38,5 +38,14 @@ ignore_file \.rpm(save|new)$ # doesn't understand CIDR-style network notation. You may repeat # the allow line as many times as you'd like -allow ^192\.25\.206\.57$ -allow ^192\.25\.206\.33$ +<%= +str = '' +localinfo.keys.sort.each do |node| + if localinfo[node]['muninmaster'] + keyinfo[node][0]['ipHostNumber'].each do |ip| + str += "allow " + ip.split('.').join('\.') + "$\n" + end + end +end +str +-%> -- 2.39.2