Sha256: b1bf858fdc55295085fa4a85962ae56deeb29abc34e21a139c64cd44e580f769

Contents?: true

Size: 1007 Bytes

Versions: 67

Compression:

Stored size: 1007 Bytes

Contents

# Fact: kernelrelease
#
# Purpose: Return the operating system's release number.
#
# Resolution:
#   On AIX, returns the output from the `oslevel -s` system command.
#   On Windows-based systems, uses the win32ole gem to query Windows Management
#   for the `Win32_OperatingSystem` value.
#   Otherwise uses the output of `uname -r` system command.
#
# Caveats:
#
require 'facter/util/posix'
require 'facter/util/windows'

Facter.add(:kernelrelease) do
  setcode 'uname -r'
end

Facter.add(:kernelrelease) do
  confine :kernel => "aix"
  setcode 'oslevel -s'
end

Facter.add("kernelrelease") do
  confine :kernel => :openbsd
  setcode do
    Facter::Util::POSIX.sysctl("kern.version").split(' ')[1]
  end
end

Facter.add(:kernelrelease) do
  confine :kernel => "hp-ux"
  setcode do
    version = Facter::Core::Execution.execute('uname -r')
    version[2..-1]
  end
end

Facter.add(:kernelrelease) do
  confine :kernel => "windows"
  setcode do
    Facter::Util::Windows::Process.os_version_string
  end
end

Version data entries

67 entries across 67 versions & 2 rubygems

Version Path
bolt-0.17.0 vendored/facter/lib/facter/kernelrelease.rb
bolt-0.16.4 vendored/facter/lib/facter/kernelrelease.rb
bolt-0.16.3 vendored/facter/lib/facter/kernelrelease.rb
bolt-0.16.2 vendored/facter/lib/facter/kernelrelease.rb
bolt-0.16.1 vendored/facter/lib/facter/kernelrelease.rb
bolt-0.16.0 vendored/facter/lib/facter/kernelrelease.rb
bolt-0.15.0 vendored/facter/lib/facter/kernelrelease.rb
bolt-0.14.0 vendored/facter/lib/facter/kernelrelease.rb
bolt-0.13.0 vendored/facter/lib/facter/kernelrelease.rb
bolt-0.12.0 vendored/facter/lib/facter/kernelrelease.rb
bolt-0.11.0 vendored/facter/lib/facter/kernelrelease.rb
bolt-0.10.0 vendored/facter/lib/facter/kernelrelease.rb
bolt-0.9.0 vendored/facter/lib/facter/kernelrelease.rb
bolt-0.8.0 vendored/facter/lib/facter/kernelrelease.rb
bolt-0.7.0 vendored/facter/lib/facter/kernelrelease.rb
bolt-0.6.1 vendored/facter/lib/facter/kernelrelease.rb
bolt-0.6.0 vendored/facter/lib/facter/kernelrelease.rb
bolt-0.5.1 vendored/facter/lib/facter/kernelrelease.rb
bolt-0.5.0 vendored/facter/lib/facter/kernelrelease.rb
facter-2.5.1 lib/facter/kernelrelease.rb