From: Stephen Gran Date: Sun, 21 Feb 2010 15:11:33 +0000 (+0000) Subject: template the munin master as well X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b67bdf5441bbd3fe0bd399623c779ab6c3dc22a9;p=dsa-puppet.git template the munin master as well Signed-off-by: Stephen Gran --- diff --git a/modules/munin-node/files/common/munin-node.conf b/modules/munin-node/files/common/munin-node.conf deleted file mode 100644 index 84906d4c..00000000 --- a/modules/munin-node/files/common/munin-node.conf +++ /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$ 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/templates/munin-node.conf.erb b/modules/munin-node/templates/munin-node.conf.erb new file mode 100644 index 00000000..070adb06 --- /dev/null +++ b/modules/munin-node/templates/munin-node.conf.erb @@ -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 +-%>