]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
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 de30d49a1bce570e8590eb01cd7502968988234f..533c77933cdfa9ef0a5ae6dda26c86c3578907f7 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 d5df24ef8741b23fd137cc813613b6434633f21b..8258f9b13248eab8ee0c2ae91971f0ffa141f42b 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 5f8dee9b05363e7017faa0a0137f895813bd6d1f..1d8864e2a680aef4f0b26a7dd4413286dea3157a 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 6f606e3712bd51bafa3e4ad3690c56edd5210c50..e53aba3aac273664518975efdfff9e689d716ead 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 e163d29f7ec2b72f262094c4684d802fc2acdb87..c7f39b625f8179bb1bbc26394bb03da3b8e224d0 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 b223bd650cca9f7e89b8033ad4bbe6414a505ca9..519e033a6e73008c51c7012b4de133c09d3e0d95 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 -%>