From: Stephen Gran Date: Mon, 9 Mar 2009 19:26:44 +0000 (+0000) Subject: Add software raid test X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=68e9064da4758c291c8e7b839955f5031db00416;p=mirror%2Fdsa-puppet.git Add software raid test Signed-off-by: Stephen Gran --- diff --git a/facts/raidcontroller.rb b/facts/raidcontroller.rb index f2834c2dc..263b16b24 100644 --- a/facts/raidcontroller.rb +++ b/facts/raidcontroller.rb @@ -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 +