Sha256: 474a8449e012e6a6740f2691bff292b4ce09e584e803e3e8d0d07be42d769990
Contents?: true
Size: 749 Bytes
Versions: 13
Compression:
Stored size: 749 Bytes
Contents
# Fact: hardwaremodel # # Purpose: # Returns the hardware model of the system. # # Resolution: # Uses purely "uname -m" on all platforms other than AIX and Windows. # On AIX uses the parsed "modelname" output of "lsattr -El sys0 -a modelname". # On Windows uses the 'host_cpu' pulled out of Ruby's config. # # Caveats: # Facter.add(:hardwaremodel) do setcode 'uname -m' end Facter.add(:hardwaremodel) do confine :operatingsystem => :aix setcode do model = Facter::Util::Resolution.exec('lsattr -El sys0 -a modelname') if model =~ /modelname\s(\S+)\s/ $1 end end end Facter.add(:hardwaremodel) do confine :operatingsystem => :windows setcode do require 'rbconfig' Config::CONFIG['host_cpu'] end end
Version data entries
13 entries across 13 versions & 2 rubygems