Sha256: febedeed4a8eda6695518d02adf42d3c402b237eae1d0841f68ee74811efce93

Contents?: true

Size: 754 Bytes

Versions: 29

Compression:

Stored size: 754 Bytes

Contents

# Fact: architecture
#
# Purpose:
#   Return the CPU hardware architecture.
#
# Resolution:
#   On OpenBSD, Linux and Debian's kfreebsd, use the hardwaremodel fact.
#   Gentoo and Debian call "x86_86" "amd64".
#   Gentoo also calls "i386" "x86".
#
# Caveats:
#

Facter.add(:architecture) do
  setcode do
    model = Facter.value(:hardwaremodel)
    case model
      # most linuxen use "x86_64"
    when "x86_64"
      case Facter.value(:operatingsystem)
      when "Debian", "Gentoo", "GNU/kFreeBSD", "Ubuntu"
        "amd64"
      else
        model
      end
    when /(i[3456]86|pentium)/
      case Facter.value(:operatingsystem)
      when "Gentoo", "windows"
        "x86"
      else
        "i386"
      end
    else
      model
    end
  end
end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
facter-1.7.3 lib/facter/architecture.rb
facter-1.7.3.rc1 lib/facter/architecture.rb
facter-1.7.2 lib/facter/architecture.rb
facter-1.7.2.rc1 lib/facter/architecture.rb
facter-1.7.1 lib/facter/architecture.rb
facter-1.7.1.rc1 lib/facter/architecture.rb
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/facter-1.6.17/lib/facter/architecture.rb
facter-1.7.0 lib/facter/architecture.rb
facter-1.7.0.rc2 lib/facter/architecture.rb
facter-1.7.0.rc1 lib/facter/architecture.rb
facter-1.6.18 lib/facter/architecture.rb
facter-1.6.18.rc1 lib/facter/architecture.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/facter-1.6.17/lib/facter/architecture.rb
facter-1.6.17 lib/facter/architecture.rb
facter-1.6.17.rc1 lib/facter/architecture.rb
facter-1.6.16 lib/facter/architecture.rb
facter-1.6.15 lib/facter/architecture.rb
facter-1.6.15.rc1 lib/facter/architecture.rb
facter-1.6.14 lib/facter/architecture.rb
facter-1.6.14.rc1 lib/facter/architecture.rb