9b95aa0a35
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
7 lines
321 B
Ruby
7 lines
321 B
Ruby
require 'facter'
|
|
Facter.add(:is_primary_disk_rotational) do
|
|
rootfs_partition = Facter::Core::Execution.exec("df --output=source / | tail -1")
|
|
rootfs_device = Facter::Core::Execution.exec("basename #{rootfs_partition} | sed 's/[0-9]*$//;s/p[0-9]*$//'")
|
|
setcode "cat /sys/block/#{rootfs_device}/queue/rotational"
|
|
end
|