]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
template the munin master as well
authorStephen Gran <steve@lobefin.net>
Sun, 21 Feb 2010 15:11:33 +0000 (15:11 +0000)
committerStephen Gran <steve@lobefin.net>
Sun, 21 Feb 2010 15:11:33 +0000 (15:11 +0000)
Signed-off-by: Stephen Gran <steve@lobefin.net>
modules/munin-node/files/common/munin-node.conf [deleted file]
modules/munin-node/manifests/init.pp
modules/munin-node/templates/munin-node.conf.erb [new file with mode: 0644]

diff --git a/modules/munin-node/files/common/munin-node.conf b/modules/munin-node/files/common/munin-node.conf
deleted file mode 100644 (file)
index 84906d4..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-##
-## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
-## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
-##
-
-#
-# Example config-file for munin-node
-#
-
-log_level 4
-log_file /var/log/munin/munin-node.log
-port 4949
-pid_file /var/run/munin/munin-node.pid
-background 1
-setseid 1
-
-# Which port to bind to;
-host *
-user root
-group root
-setsid yes
-
-# Regexps for files to ignore
-
-ignore_file ~$
-ignore_file \.bak$
-ignore_file %$
-ignore_file \.dpkg-(tmp|new|old|dist)$
-ignore_file \.rpm(save|new)$
-
-# Set this if the client doesn't report the correct hostname when
-# telnetting to localhost, port 4949
-#
-#host_name localhost.localdomain
-
-# A list of addresses that are allowed to connect.  This must be a
-# regular expression, due to brain damage in Net::Server, which
-# 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$
index 5ddbf6eb3d86c1150cf5f08719be8bf94c14effe..ac999ef90a0a5a666ca6558150a5c86cd33f36f0 100644 (file)
@@ -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/templates/munin-node.conf.erb b/modules/munin-node/templates/munin-node.conf.erb
new file mode 100644 (file)
index 0000000..070adb0
--- /dev/null
@@ -0,0 +1,51 @@
+##
+## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
+##
+
+#
+# Example config-file for munin-node
+#
+
+log_level 4
+log_file /var/log/munin/munin-node.log
+port 4949
+pid_file /var/run/munin/munin-node.pid
+background 1
+setseid 1
+
+# Which port to bind to;
+host *
+user root
+group root
+setsid yes
+
+# Regexps for files to ignore
+
+ignore_file ~$
+ignore_file \.bak$
+ignore_file %$
+ignore_file \.dpkg-(tmp|new|old|dist)$
+ignore_file \.rpm(save|new)$
+
+# Set this if the client doesn't report the correct hostname when
+# telnetting to localhost, port 4949
+#
+#host_name localhost.localdomain
+
+# A list of addresses that are allowed to connect.  This must be a
+# regular expression, due to brain damage in Net::Server, which
+# doesn't understand CIDR-style network notation.  You may repeat
+# the allow line as many times as you'd like
+
+<%=
+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
+-%>