There's been quite a few cases recently of people wanting disk facts so I 
thought I'd try my hand at writing some.

I modeled it roughly on the IP facts, typical output looks like this:

# xen virtual machine
diskdrives => xvda
diskmodel_xvda => Xen Virtual Disk
disksize_xvda => 10485760
disktype_xvda => xvd

# SATA
diskdrives => sda,sdb
diskmodel_sda => SAMSUNG HD403LJ
diskmodel_sdb => SAMSUNG HD403LJ
disksize_sda => 781422768
disksize_sdb => 781422768
disktype_sda => scsi
disktype_sdb => scsi

# IDE (model is correct, that's what the kernel says)
diskdrives => hdc
diskmodel_hdc => (none)
disksize_hdc => 7928928
disktype_hdc => ide

At present it just understands linux and only SCSI, IDE and Xen VD on Linux.  I 
do not have access to other machines but would be keen to get help from people 
with at least one other platform or disk type (like openvz)

The code isn't particularly great, I could enhance it like the ip ones does 
with a map and utility classes, but I'll leave that for another nights hacking.

The one main problem I'm having is that statements like:
  
  File.read(sfile).chomp if File.exists?(sfile)

Works when running just 'facter' they work when running puppetd --test but they 
do not work when running puppet as a daemon, if I log before and after I never 
get to the after.  I tried catching any excpetions etc, it just never throws 
any it just hangs.  So at present I just use cat to load them :(

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to