]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
Add software raid test
authorStephen Gran <steve@lobefin.net>
Mon, 9 Mar 2009 19:26:44 +0000 (19:26 +0000)
committerStephen Gran <steve@lobefin.net>
Mon, 9 Mar 2009 19:26:44 +0000 (19:26 +0000)
Signed-off-by: Stephen Gran <steve@lobefin.net>
facts/raidcontroller.rb

index f2834c2dcf3a72abc81f4ee7f94523a9b8a8dfb5..263b16b24f95d3b11fbf6372b15c1ee83f2b90d1 100644 (file)
@@ -32,3 +32,17 @@ Facter.add("3warecontroller") do
                is3w
        end
 end
+
+Facter.add("swraid") do
+       confine :kernel => :linux
+       setcode do
+                swraid = "false"
+               if FileTest.exist?("/proc/mdstat") && FileTest.exist?("/sbin/mdadm")
+                        IO.foreach("/proc/mdstat") { |x|
+                                swraid = "true" if x =~ /md[0-9]+ : active/
+                        }
+                end
+                swraid
+       end
+end
+