From a332ba3ac062949367db794e0adb6cca2d39dda5 Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Sat, 28 Feb 2009 18:51:27 +0000 Subject: [PATCH] Add attempt at custom fact to interrogate what raid controllers are on a given system (first step to making sure HP software is installed on Proliants). Signed-off-by: Stephen Gran --- .../debian-org/plugins/facter/raidcontroller.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 modules/debian-org/plugins/facter/raidcontroller.rb diff --git a/modules/debian-org/plugins/facter/raidcontroller.rb b/modules/debian-org/plugins/facter/raidcontroller.rb new file mode 100644 index 00000000..5ec322ac --- /dev/null +++ b/modules/debian-org/plugins/facter/raidcontroller.rb @@ -0,0 +1,15 @@ +Facter.add("raidcontroller") do + confine :kernel => :linux + ENV["PATH"]="/bin:/sbin:/usr/bin:/usr/sbin" + setcode do + controllers = [] + lspciexists = system "/bin/bash -c 'which lspci >&/dev//null'" + if $?.exitstatus == 0 + output = %x{lspci} + output.each { |s| + controllers.push($1) if s =~ /RAID bus controller: (.*)/ + } + end + controllers + end +end -- 2.39.2