More munin stuff, supporting munin-async if it is on the client
authorPeter Palfrader <peter@palfrader.org>
Mon, 27 Aug 2012 12:14:22 +0000 (12:14 +0000)
committerPeter Palfrader <peter@palfrader.org>
Mon, 27 Aug 2012 12:14:22 +0000 (12:14 +0000)
modules/debian-org/lib/facter/software.rb
modules/munin/files/munin-async-authkeys [new file with mode: 0644]
modules/munin/manifests/init.pp
modules/munin/manifests/master-per-node.pp
modules/munin/manifests/master.pp
modules/munin/templates/munin.conf-per-node.erb
modules/munin/templates/munin.conf.erb

index de30d49..533c779 100644 (file)
@@ -142,7 +142,7 @@ Facter.add("unbound") do
                end
        end
 end
-Facter.add("munin-async") do
+Facter.add("munin_async") do
        setcode do
                FileTest.exist?("/usr/share/munin/munin-async")
        end
diff --git a/modules/munin/files/munin-async-authkeys b/modules/munin/files/munin-async-authkeys
new file mode 100644 (file)
index 0000000..bf33aec
--- /dev/null
@@ -0,0 +1 @@
+command="/usr/share/munin/munin-async --spoolfetch",from="206.12.19.143",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty,no-user-rc ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCiaY2clXjSIwjwBKolGN+JYuCev6kXzxPbX7pG8zVmdOjfEVpS2gPbWDliIyrpSxXbOPjswHcBEh67NWLAb4lLaAQ/neWrCzzri6hyPQMsl27kqFUzqHbqJml5tTDJlT/wBrNThuWIAWblS9Ck44fPnoRcJEyosGF1dOZVwYvcTGGLQMRq3U09HgatFJvNVX4x2IVBo5jDOCOZSGx5Ur+vAIJSxcQFY4DuT5Ee3ggx7g1PU36ciL0I0Ep3T8epr0yJwrXjtnpvJHOr3q4zDt5L5+XFZeozeYzG6w3NNVYA52knVNNsIzwKiy+hyHwiLf+Si0h4iTQ60jUr2pcOAeVn munin@menotti (2012-08-07)
index d5df24e..8258f9b 100644 (file)
@@ -60,5 +60,20 @@ class munin {
                notarule        => true,
        }
 
-       @@munin::master-per-node { $::fqdn: }
+       @@munin::master-per-node {
+               $::fqdn:
+                       ipaddress => $::ipaddress,
+                       munin_async => $::munin_async,
+                       ;
+       }
+
+       if $munin_async and $munin_async == 'true' {
+               file { '/etc/ssh/userkeys/munin-async':
+                       source => 'puppet:///modules/munin/munin-async-authkeys',
+               }
+       } else {
+               file { '/etc/ssh/userkeys/munin-async':
+                       ensure => 'absent',
+               }
+       }
 }
index 5f8dee9..1d8864e 100644 (file)
@@ -1,4 +1,8 @@
-define munin::master-per-node() {
+define munin::master-per-node($ipaddress, $munin_async) {
+       $client_fqdn               = $name
+       $client_ipaddress          = $ipaddress
+       $client_munin_async        = $munin_async
+
        file { "/etc/munin/munin-conf.d/${name}.conf":
                content => template('munin/munin.conf-per-node.erb'),
        }
index 6f606e3..e53aba3 100644 (file)
@@ -11,9 +11,12 @@ class munin::master {
 
        if $::hostname == 'menotti' {
                file { '/etc/munin/munin-conf.d':
-                       ensure => directory,
-                       mode   => 755,
-                       ;
+                       ensure  => directory,
+                       mode    => '0755',
+                       purge   => true,
+                       force   => true,
+                       recurse => true,
+                       source  => 'puppet:///files/empty/',
                }
 
                Munin::Master-per-node<<| |>>
index e163d29..c7f39b6 100644 (file)
@@ -2,5 +2,9 @@
 ### THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
 ##
 
-[<%= fqdn %>]
-    address <%= ipaddress %>
+[<%= client_fqdn %>]
+<%- if has_variable?('client_munin_async') and client_munin_async and client_munin_async == "true" %>
+    address ssh://munin-async@<%= client_fqdn %>/set-in-authkeys
+<%- else %>
+    address <%= client_ipaddress %>
+<%- end %>
index b223bd6..519e033 100644 (file)
@@ -3,6 +3,10 @@
 ### USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
 ##
 
+includedir /etc/munin/munin-conf.d
+
+<% if hostname != "menotti" -%>
+
 dbdir   /var/lib/munin
 htmldir /var/cache/munin/www
 logdir  /var/log/munin
@@ -21,3 +25,4 @@ graph_strategy cgi
     end
 out
 %>
+<% end -%>