retire old DNS root key
[mirror/dsa-puppet.git] / modules / debian_org / lib / facter / raidarray.rb
1 Facter.add("smartarraycontroller") do
2         confine :kernel => :linux
3         setcode do
4                 if FileTest.exist?("/dev/cciss/")
5                         true
6                 elsif FileTest.exist?("/sys/module/hpsa/")
7                         true
8                 else
9                         false
10                 end
11         end
12 end
13
14 Facter.add("smartarraycontroller_cciss") do
15         confine :kernel => :linux
16         setcode do
17                 FileTest.exist?("/dev/cciss/")
18         end
19 end
20
21 Facter.add("smartarraycontroller_hpsa") do
22         confine :kernel => :linux
23         setcode do
24                 FileTest.exist?("/sys/module/hpsa/")
25         end
26 end
27
28
29 Facter.add("ThreeWarecontroller") do
30         confine :kernel => :linux
31         setcode do
32                 is3w = false
33                 if FileTest.exist?("/proc/scsi/scsi")
34                         IO.foreach("/proc/scsi/scsi") { |x|
35                                 is3w = true if x =~ /Vendor: 3ware/
36                         }
37                 end
38                 is3w
39         end
40 end
41
42 Facter.add("megaraid") do
43         confine :kernel => :linux
44         setcode do
45                 if FileTest.exist?("/dev/megadev0")
46                         true
47                 else
48                         false
49                 end
50         end
51 end
52
53 Facter.add("mptraid") do
54         confine :kernel => :linux
55         setcode do
56                 if FileTest.exist?("/dev/mptctl") or FileTest.exist?("/dev/mpt0") or FileTest.exist?("/proc/mpt/summary")
57                         true
58                 else
59                         false
60                 end
61         end
62 end
63
64 Facter.add("aacraid") do
65         confine :kernel => :linux
66         setcode do
67                 if FileTest.exist?("/dev/aac0")
68                         true
69                 else
70                         false
71                 end
72         end
73 end
74
75 Facter.add("swraid") do
76         confine :kernel => :linux
77         setcode do
78                 swraid = false
79                 if FileTest.exist?("/proc/mdstat") && FileTest.exist?("/sbin/mdadm")
80                         IO.foreach("/proc/mdstat") { |x|
81                                 swraid = true if x =~ /md[0-9]+ : active/
82                         }
83                 end
84                 swraid
85         end
86 end
87