fix munin 1
[mirror/dsa-puppet.git] / modules / debian-org / lib / facter / paths.rb
index e48fb60..47a010c 100644 (file)
@@ -1,27 +1,20 @@
-Facter.add("has_srv_build_trees") do
-       setcode do
-               if FileTest.exist?("/srv/build-trees")
-                       true
-               else
-                       ''
-               end
-       end
-end
-Facter.add("has_srv_buildd") do
-       setcode do
-               if FileTest.exist?("/srv/buildd")
-                       true
-               else
-                       ''
-               end
-       end
-end
-Facter.add("has_etc_ssh_ssh_host_ed25519_key") do
-       setcode do
-               if FileTest.exist?("/etc/ssh/ssh_host_ed25519_key")
-                       true
-               else
-                       ''
+
+%w{/srv/build-trees
+   /srv/buildd
+   /etc/ssh/ssh_host_ed25519_key
+   /srv/mirrors/debian
+   /srv/mirrors/debian-debug
+   /srv/mirrors/debian-ports
+   /srv/mirrors/debian-security
+   /dev/hwrng
+}.each do |path|
+       Facter.add("has" + path.gsub(/[\/-]/,'_')) do
+               setcode do
+                       if FileTest.exist?(path)
+                               true
+                       else
+                               ''
+                       end
                end
        end
 end