aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/facter/disks.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/facter/disks.rb b/lib/facter/disks.rb
new file mode 100644
index 0000000..60975e5
--- /dev/null
+++ b/lib/facter/disks.rb
@@ -0,0 +1,7 @@
+# return the list of disks
+Facter.add("disks") do
+ confine :kernel => :linux
+ setcode do
+ `egrep '[sh]d[a-z]+$' /proc/partitions | awk '{ print $4 }' | xargs`.split(' ')
+ end
+end