Facter.add(:mdarrays) do confine :kernel => :linux setcode do arrays = [] mdstat = "/proc/mdstat" if File.exists?(mdstat) File.readlines(mdstat).each do |line| if m = line.match(/^md[0-9]+/) arrays << m[0] end end end arrays.sort.join(',') end end