Sha256: 77bc24c4a194f4fce69f8f49fb4831768622b2b134ac0c8a8b52fc4ebd52aab6

Contents?: true

Size: 1019 Bytes

Versions: 4

Compression:

Stored size: 1019 Bytes

Contents

# Fact: osfamily
#
# Purpose: Returns the operating system
#
# Resolution:
#   Maps operating systems to operating system families, such as linux
#   distribution derivatives. Adds mappings from specific operating systems
#   to kernels in the case that it is relevant.
#
# Caveats:
#   This fact is completely reliant on the operatingsystem fact, and no
#   heuristics are used
#

Facter.add(:osfamily) do

  setcode do
    case Facter.value(:operatingsystem)
    when "RedHat", "Fedora", "CentOS", "Scientific", "SLC", "Ascendos", "CloudLinux", "PSBM", "OracleLinux", "OVS", "OEL", "Amazon", "XenServer"
      "RedHat"
    when "LinuxMint", "Ubuntu", "Debian", "CumulusLinux"
      "Debian"
    when "SLES", "SLED", "OpenSuSE", "SuSE"
      "Suse"
    when "Solaris", "Nexenta", "OmniOS", "OpenIndiana", "SmartOS"
      "Solaris"
    when "Gentoo"
      "Gentoo"
    when "Archlinux"
      "Archlinux"
    when "Mageia", "Mandriva", "Mandrake"
      "Mandrake"
    else
      Facter.value("kernel")
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
facter-2.1.0 lib/facter/osfamily.rb
facter-2.1.0-x86-mingw32 lib/facter/osfamily.rb
facter-2.1.0-x64-mingw32 lib/facter/osfamily.rb
facter-2.1.0-universal-darwin lib/facter/osfamily.rb