Sha256: 0852914beb63fb47e78df7a6c7eb8d9d447461bedc87560a9b5055217dea29f4
Contents?: true
Size: 950 Bytes
Versions: 6
Compression:
Stored size: 950 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: # 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 => "hp-ux" setcode do version = Facter::Core::Execution.exec('uname -r') version[2..-1] end end Facter.add(:kernelrelease) do confine :kernel => "windows" setcode do require 'facter/util/wmi' version = "" Facter::Util::WMI.execquery("SELECT Version from Win32_OperatingSystem").each do |ole| version = "#{ole.Version}" break end version end end
Version data entries
6 entries across 6 versions & 1 rubygems