Class: Facter::Operatingsystem::SunOS
- Inherits:
-
Base
- Object
- Base
- Facter::Operatingsystem::SunOS
show all
- Defined in:
- lib/facter/operatingsystem/sunos.rb
Instance Method Summary
collapse
Methods inherited from Base
#get_operatingsystemminorrelease, #get_operatingsystemrelease_hash, #has_lsb?
Instance Method Details
#get_operatingsystem ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/facter/operatingsystem/sunos.rb', line 7
def get_operatingsystem
output = Facter::Core::Execution.exec('uname -v')
if output =~ /^joyent_/
"SmartOS"
elsif output =~ /^oi_/
"OpenIndiana"
elsif output =~ /^omnios-/
"OmniOS"
elsif FileTest.exists?("/etc/debian_version")
"Nexenta"
else
"Solaris"
end
end
|
#get_operatingsystemmajorrelease ⇒ Object
45
46
47
48
49
50
51
|
# File 'lib/facter/operatingsystem/sunos.rb', line 45
def get_operatingsystemmajorrelease
if get_operatingsystem == "Solaris"
if match = get_operatingsystemrelease.match(/^(\d+)/)
match.captures[0]
end
end
end
|
#get_operatingsystemrelease ⇒ Object
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/facter/operatingsystem/sunos.rb', line 26
def get_operatingsystemrelease
if release = Facter::Util::FileRead.read('/etc/release')
line = release.split("\n").first
if match = /\s+s(\d+)[sx]?(_u\d+)?.*(?:SPARC|X86)/.match(line)
match.captures.join('')
elsif match = /Solaris ([0-9\.]+(?:\s*[0-9\.\/]+))\s*(?:SPARC|X86)/.match(line)
match.captures[0]
else
Facter[:kernelrelease].value
end
else
Facter[:kernelrelease].value
end
end
|
#get_osfamily ⇒ Object
22
23
24
|
# File 'lib/facter/operatingsystem/sunos.rb', line 22
def get_osfamily
"Solaris"
end
|