Sha256: d79714c287b74cb668e20d78c0993e6c60008e2b9248bf1c4053e274953bab53

Contents?: true

Size: 972 Bytes

Versions: 21

Compression:

Stored size: 972 Bytes

Contents

# Fact: operatingsystemmajrelease
#
# Purpose: Returns the major release of the operating system.
#
# Resolution: splits down the operatingsystemrelease fact at decimal point for
#  osfamily RedHat derivatives and Debian.
#
# This should be the same as lsbmajdistrelease, but on minimal systems there
# are too many dependencies to use LSB
#
# List of operatingsystems at time of writing:
#"Alpine" "Amazon" "Archlinux" "Ascendos" "Bluewhite64" "CentOS" "CloudLinux" 
#"Debian" "Fedora" "Gentoo" "Mandrake" "Mandriva" "MeeGo" "OEL" "OpenSuSE" 
#"OracleLinux" "OVS" "PSBM" "RedHat" "Scientific" "Slackware" "Slamd64" "SLC"
#"SLED" "SLES" "SuSE" "Ubuntu" "VMWareESX"
Facter.add(:operatingsystemmajrelease) do
  confine :operatingsystem => [
    :Amazon,
    :CentOS,
    :CloudLinux,
    :Debian,
    :Fedora,
    :OEL,
    :OracleLinux,
    :OVS,
    :RedHat,
    :Scientific,
    :SLC
  ]
  setcode do
    Facter.value('operatingsystemrelease').split('.').first
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
facter-1.7.6 lib/facter/operatingsystemmajrelease.rb
facter-2.0.1.rc2 lib/facter/operatingsystemmajrelease.rb
facter-2.0.1.rc2-x86-mingw32 lib/facter/operatingsystemmajrelease.rb
facter-2.0.1.rc2-universal-darwin lib/facter/operatingsystemmajrelease.rb
facter-2.0.1.rc1 lib/facter/operatingsystemmajrelease.rb
facter-2.0.1.rc1-x86-mingw32 lib/facter/operatingsystemmajrelease.rb
facter-2.0.1.rc1-universal-darwin lib/facter/operatingsystemmajrelease.rb
facter-1.7.5 lib/facter/operatingsystemmajrelease.rb
facter-1.7.5.rc2 lib/facter/operatingsystemmajrelease.rb
facter-1.7.5.rc1 lib/facter/operatingsystemmajrelease.rb
facter-1.7.4 lib/facter/operatingsystemmajrelease.rb
facter-1.7.4.rc1 lib/facter/operatingsystemmajrelease.rb
facter-1.7.3 lib/facter/operatingsystemmajrelease.rb
facter-1.7.3.rc1 lib/facter/operatingsystemmajrelease.rb
facter-1.7.2 lib/facter/operatingsystemmajrelease.rb
facter-1.7.2.rc1 lib/facter/operatingsystemmajrelease.rb
facter-1.7.1 lib/facter/operatingsystemmajrelease.rb
facter-1.7.1.rc1 lib/facter/operatingsystemmajrelease.rb
facter-1.7.0 lib/facter/operatingsystemmajrelease.rb
facter-1.7.0.rc2 lib/facter/operatingsystemmajrelease.rb