facter 2.1.0-x86-mingw32 → 2.2.0-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of facter might be problematic. Click here for more details.
- data/COMMITTERS.md +25 -34
- data/CONTRIBUTING.md +27 -5
- data/README.md +32 -0
- data/ext/build_defaults.yaml +1 -1
- data/ext/debian/control +3 -2
- data/ext/osx/file_mapping.yaml +5 -0
- data/ext/redhat/facter.spec.erb +4 -1
- data/lib/facter/Cfkey.rb +2 -2
- data/lib/facter/architecture.rb +2 -2
- data/lib/facter/augeasversion.rb +2 -2
- data/lib/facter/blockdevices.rb +12 -12
- data/lib/facter/dhcp_servers.rb +4 -4
- data/lib/facter/domain.rb +4 -4
- data/lib/facter/ec2.rb +17 -0
- data/lib/facter/ec2/rest.rb +2 -2
- data/lib/facter/facterversion.rb +2 -2
- data/lib/facter/filesystems.rb +10 -3
- data/lib/facter/fqdn.rb +1 -1
- data/lib/facter/gid.rb +16 -0
- data/lib/facter/hardwareisa.rb +3 -3
- data/lib/facter/hardwaremodel.rb +3 -3
- data/lib/facter/hostname.rb +1 -1
- data/lib/facter/id.rb +4 -4
- data/lib/facter/interfaces.rb +3 -0
- data/lib/facter/ipaddress6.rb +9 -9
- data/lib/facter/kernel.rb +2 -2
- data/lib/facter/kernelmajversion.rb +2 -2
- data/lib/facter/kernelrelease.rb +4 -4
- data/lib/facter/kernelversion.rb +3 -3
- data/lib/facter/ldom.rb +11 -0
- data/lib/facter/lsbdistcodename.rb +8 -4
- data/lib/facter/lsbdistdescription.rb +6 -10
- data/lib/facter/lsbdistid.rb +8 -4
- data/lib/facter/lsbdistrelease.rb +8 -4
- data/lib/facter/lsbmajdistrelease.rb +7 -12
- data/lib/facter/lsbminordistrelease.rb +22 -0
- data/lib/facter/lsbrelease.rb +8 -4
- data/lib/facter/macaddress.rb +1 -0
- data/lib/facter/macosx.rb +1 -1
- data/lib/facter/manufacturer.rb +3 -3
- data/lib/facter/memory.rb +8 -8
- data/lib/facter/netmask.rb +2 -1
- data/lib/facter/network.rb +3 -3
- data/lib/facter/operatingsystem.rb +9 -126
- data/lib/facter/operatingsystem/base.rb +61 -0
- data/lib/facter/operatingsystem/cumuluslinux.rb +27 -0
- data/lib/facter/operatingsystem/implementation.rb +30 -0
- data/lib/facter/operatingsystem/linux.rb +467 -0
- data/lib/facter/operatingsystem/sunos.rb +54 -0
- data/lib/facter/operatingsystem/vmkernel.rb +11 -0
- data/lib/facter/operatingsystem/windows.rb +37 -0
- data/lib/facter/operatingsystemmajrelease.rb +14 -33
- data/lib/facter/operatingsystemrelease.rb +14 -235
- data/lib/facter/os.rb +69 -0
- data/lib/facter/osfamily.rb +4 -23
- data/lib/facter/partitions.rb +4 -3
- data/lib/facter/path.rb +2 -2
- data/lib/facter/physicalprocessorcount.rb +10 -74
- data/lib/facter/processor.rb +13 -129
- data/lib/facter/processors.rb +60 -0
- data/lib/facter/processors/os.rb +234 -0
- data/lib/facter/ps.rb +5 -4
- data/lib/facter/puppetversion.rb +1 -1
- data/lib/facter/rackspace.rb +34 -0
- data/lib/facter/rubysitedir.rb +3 -0
- data/lib/facter/rubyversion.rb +2 -2
- data/lib/facter/selinux.rb +57 -2
- data/lib/facter/ssh.rb +1 -0
- data/lib/facter/system_uptime.rb +42 -0
- data/lib/facter/timezone.rb +1 -1
- data/lib/facter/uptime.rb +5 -23
- data/lib/facter/uptime_days.rb +4 -6
- data/lib/facter/uptime_hours.rb +4 -6
- data/lib/facter/uptime_seconds.rb +5 -9
- data/lib/facter/util/formatter.rb +1 -1
- data/lib/facter/util/manufacturer.rb +1 -1
- data/lib/facter/util/partitions.rb +3 -1
- data/lib/facter/util/partitions/linux.rb +1 -1
- data/lib/facter/util/partitions/openbsd.rb +35 -0
- data/lib/facter/util/uptime.rb +4 -3
- data/lib/facter/util/virtual.rb +3 -1
- data/lib/facter/util/xendomains.rb +12 -3
- data/lib/facter/version.rb +1 -1
- data/lib/facter/virtual.rb +24 -23
- data/lib/facter/vlans.rb +1 -1
- data/lib/facter/xendomains.rb +1 -1
- data/lib/facter/zfs_version.rb +6 -2
- data/lib/facter/zones.rb +6 -5
- data/lib/facter/zpool_version.rb +1 -1
- data/spec/fixtures/cpuinfo/amd64dual-grep +2 -0
- data/spec/fixtures/cpuinfo/amd64twentyfour-grep +24 -0
- data/spec/fixtures/cpuinfo/two_multicore-grep +4 -0
- data/spec/fixtures/cpuinfo/two_singlecore-grep +2 -0
- data/spec/fixtures/unit/processors/os/darwin-system-profiler +287 -0
- data/spec/fixtures/unit/zfs_version/zfs_new +61 -0
- data/spec/fixtures/unit/zfs_version/zfs_old +43 -0
- data/spec/fixtures/unit/zfs_version/zfsonlinux_0.6.1 +13 -0
- data/spec/fixtures/unit/zpool_version/zfsonlinux_0.6.1 +48 -0
- data/spec/unit/ec2/rest_spec.rb +6 -6
- data/spec/unit/gid_spec.rb +22 -0
- data/spec/unit/hardwaremodel_spec.rb +2 -0
- data/spec/unit/lsbdistcodename_spec.rb +22 -17
- data/spec/unit/lsbdistdescription_spec.rb +22 -17
- data/spec/unit/lsbdistid_spec.rb +23 -18
- data/spec/unit/lsbdistrelease_spec.rb +22 -17
- data/spec/unit/lsbmajdistrelease_spec.rb +23 -6
- data/spec/unit/lsbminordistrelease_spec.rb +31 -0
- data/spec/unit/lsbrelease_spec.rb +22 -17
- data/spec/unit/macaddress_spec.rb +3 -0
- data/spec/unit/operatingsystem/base_spec.rb +76 -0
- data/spec/unit/operatingsystem/cumuluslinux_spec.rb +40 -0
- data/spec/unit/operatingsystem/implementation_spec.rb +49 -0
- data/spec/unit/operatingsystem/linux_spec.rb +538 -0
- data/spec/unit/operatingsystem/sunos_spec.rb +144 -0
- data/spec/unit/operatingsystem/vmkernel_spec.rb +13 -0
- data/spec/unit/operatingsystem/windows_spec.rb +68 -0
- data/spec/unit/operatingsystem_spec.rb +10 -153
- data/spec/unit/operatingsystemmajrelease_spec.rb +14 -31
- data/spec/unit/operatingsystemrelease_spec.rb +13 -229
- data/spec/unit/os_spec.rb +131 -0
- data/spec/unit/osfamily_spec.rb +9 -54
- data/spec/unit/partitions_spec.rb +41 -3
- data/spec/unit/physicalprocessorcount_spec.rb +6 -78
- data/spec/unit/processor_spec.rb +18 -381
- data/spec/unit/processors/os_spec.rb +446 -0
- data/spec/unit/processors_spec.rb +203 -0
- data/spec/unit/rackspace_spec.rb +40 -0
- data/spec/unit/system_uptime_spec.rb +80 -0
- data/spec/unit/util/formatter_spec.rb +5 -0
- data/spec/unit/util/macaddress_spec.rb +2 -0
- data/spec/unit/util/processor_spec.rb +120 -0
- data/spec/unit/util/uptime_spec.rb +3 -4
- data/spec/unit/util/virtual_spec.rb +8 -0
- data/spec/unit/util/xendomains_spec.rb +54 -9
- data/spec/unit/virtual_spec.rb +8 -1
- data/spec/unit/zfs_version_spec.rb +20 -8
- data/spec/unit/zpool_version_spec.rb +5 -0
- metadata +660 -589
- checksums.yaml +0 -7
data/lib/facter/filesystems.rb
CHANGED
@@ -1,9 +1,16 @@
|
|
1
|
+
# Fact: filesystems
|
1
2
|
#
|
2
|
-
#
|
3
|
+
# Purpose:
|
4
|
+
# This fact provides an alphabetic list of usable file systems that can
|
5
|
+
# be used for block devices like hard drives, media cards, etc.
|
3
6
|
#
|
4
|
-
#
|
5
|
-
#
|
7
|
+
# Resolution:
|
8
|
+
# Checks `/proc/filesystems`.
|
6
9
|
#
|
10
|
+
# Caveats:
|
11
|
+
# Only supports Linux.
|
12
|
+
#
|
13
|
+
|
7
14
|
Facter.add('filesystems') do
|
8
15
|
confine :kernel => :linux
|
9
16
|
setcode do
|
data/lib/facter/fqdn.rb
CHANGED
data/lib/facter/gid.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# Fact: gid
|
2
|
+
#
|
3
|
+
# Purpose: Return the GID (group identifier) of the user running puppet.
|
4
|
+
#
|
5
|
+
# Resolution:
|
6
|
+
#
|
7
|
+
# Caveats:
|
8
|
+
# Not supported in Windows yet.
|
9
|
+
#
|
10
|
+
|
11
|
+
Facter.add(:gid) do
|
12
|
+
confine do
|
13
|
+
Facter::Core::Execution.which('id')
|
14
|
+
end
|
15
|
+
setcode { Facter::Core::Execution.exec('id -ng') }
|
16
|
+
end
|
data/lib/facter/hardwareisa.rb
CHANGED
@@ -4,11 +4,11 @@
|
|
4
4
|
# Returns hardware processor type.
|
5
5
|
#
|
6
6
|
# Resolution:
|
7
|
-
# On Solaris, AIX, Linux and the BSDs simply uses the output of
|
8
|
-
# On HP-UX,
|
7
|
+
# On Solaris, AIX, Linux and the BSDs simply uses the output of `uname -p`.
|
8
|
+
# On HP-UX, `uname -m` gives us the same information.
|
9
9
|
#
|
10
10
|
# Caveats:
|
11
|
-
# Some
|
11
|
+
# Some Linuxes return unknown to `uname -p` with relative ease.
|
12
12
|
#
|
13
13
|
|
14
14
|
Facter.add(:hardwareisa) do
|
data/lib/facter/hardwaremodel.rb
CHANGED
@@ -4,9 +4,9 @@
|
|
4
4
|
# Returns the hardware model of the system.
|
5
5
|
#
|
6
6
|
# Resolution:
|
7
|
-
# Uses purely
|
8
|
-
# On AIX uses the parsed
|
9
|
-
# On Windows uses the
|
7
|
+
# Uses purely `uname -m` on all platforms other than AIX and Windows.
|
8
|
+
# On AIX uses the parsed `modelname` output of `lsattr -El sys0 -a modelname`.
|
9
|
+
# On Windows uses the `host_cpu` pulled out of Ruby's config.
|
10
10
|
#
|
11
11
|
# Caveats:
|
12
12
|
#
|
data/lib/facter/hostname.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# Purpose: Return the system's short hostname.
|
4
4
|
#
|
5
5
|
# Resolution:
|
6
|
-
# On all
|
6
|
+
# On all systems but Darwin, parses the output of the `hostname` system command
|
7
7
|
# to everything before the first period.
|
8
8
|
# On Darwin, uses the system configuration util to get the LocalHostName
|
9
9
|
# variable.
|
data/lib/facter/id.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# Fact: id
|
2
2
|
#
|
3
3
|
# Purpose: Internal fact used to specity the program to return the currently
|
4
|
-
# running user
|
4
|
+
# running user ID.
|
5
5
|
#
|
6
6
|
# Resolution:
|
7
|
-
# On all Unixes
|
8
|
-
# On Solaris, parses the output of the
|
9
|
-
# Solaris doesn't have the whoami command.
|
7
|
+
# On all Unixes but Solaris, just returns the output from `whoami`.
|
8
|
+
# On Solaris, parses the output of the `id` command to grab the username,
|
9
|
+
# as Solaris doesn't have the `whoami` command.
|
10
10
|
#
|
11
11
|
# Caveats:
|
12
12
|
#
|
data/lib/facter/interfaces.rb
CHANGED
data/lib/facter/ipaddress6.rb
CHANGED
@@ -3,15 +3,15 @@
|
|
3
3
|
# Purpose: Returns the "main" IPv6 IP address of a system.
|
4
4
|
#
|
5
5
|
# Resolution:
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
6
|
+
# OS-dependent code that parses the output of various networking
|
7
|
+
# tools and currently not very intelligent. Returns the first
|
8
|
+
# non-loopback and non-linklocal address found in the ouput unless
|
9
|
+
# a default route can be mapped to a routable interface. Guessing
|
10
|
+
# an interface is currently only possible with BSD-type systems;
|
11
|
+
# too many assumptions have to be made on other platforms to make
|
12
|
+
# this work with the current code. Most of this code is ported or
|
13
|
+
# modeled after the ipaddress fact for the sake of similar
|
14
|
+
# functionality and familiar mechanics.
|
15
15
|
#
|
16
16
|
# Caveats:
|
17
17
|
#
|
data/lib/facter/kernel.rb
CHANGED
@@ -3,8 +3,8 @@
|
|
3
3
|
# Purpose: Returns the operating system's name.
|
4
4
|
#
|
5
5
|
# Resolution:
|
6
|
-
# Uses Ruby's
|
7
|
-
# returns
|
6
|
+
# Uses Ruby's RbConfig to find host_os, if that is a Windows derivative, then
|
7
|
+
# returns `windows`, otherwise returns the output of `uname -s` verbatim.
|
8
8
|
#
|
9
9
|
# Caveats:
|
10
10
|
#
|
@@ -3,8 +3,8 @@
|
|
3
3
|
# Purpose: Return the operating system's release number's major value.
|
4
4
|
#
|
5
5
|
# Resolution:
|
6
|
-
# Takes the first
|
7
|
-
# Takes the first element of the kernel version on FreeBSD
|
6
|
+
# Takes the first two elements of the kernel version as delimited by periods.
|
7
|
+
# Takes the first element of the kernel version on FreeBSD.
|
8
8
|
#
|
9
9
|
# Caveats:
|
10
10
|
#
|
data/lib/facter/kernelrelease.rb
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
# Purpose: Return the operating system's release number.
|
4
4
|
#
|
5
5
|
# Resolution:
|
6
|
-
# On AIX returns the output from the
|
7
|
-
# On Windows
|
8
|
-
# for the
|
9
|
-
# Otherwise uses the output of
|
6
|
+
# On AIX, returns the output from the `oslevel -s` system command.
|
7
|
+
# On Windows-based systems, uses the win32ole gem to query Windows Management
|
8
|
+
# for the `Win32_OperatingSystem` value.
|
9
|
+
# Otherwise uses the output of `uname -r` system command.
|
10
10
|
#
|
11
11
|
# Caveats:
|
12
12
|
#
|
data/lib/facter/kernelversion.rb
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
# Purpose: Return the operating system's kernel version.
|
4
4
|
#
|
5
5
|
# Resolution:
|
6
|
-
# On Solaris and SunOS based machines, returns the output of
|
7
|
-
# Otherwise returns the
|
8
|
-
# the entire
|
6
|
+
# On Solaris and SunOS based machines, returns the output of `uname -v`.
|
7
|
+
# Otherwise returns the kernerlversion fact up to the first `-`. This may be
|
8
|
+
# the entire kernelversion fact in many cases.
|
9
9
|
#
|
10
10
|
# Caveats:
|
11
11
|
#
|
data/lib/facter/ldom.rb
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
# Fact: ldom
|
2
|
+
#
|
3
|
+
# Purpose:
|
4
|
+
# Returns a list of dynamic facts that describe the attributes of
|
5
|
+
# a Solaris logical domain. The facts returned will include: domainrole,
|
6
|
+
# domainname, domainuuid, domaincontrol, and domainchassis.
|
7
|
+
#
|
8
|
+
# Resolution:
|
9
|
+
# Uses the output of `virtinfo -ap`.
|
10
|
+
#
|
11
|
+
|
1
12
|
if Facter.value(:kernel) == 'SunOS' and Facter::Core::Execution.which('virtinfo')
|
2
13
|
virtinfo = Facter::Core::Execution.exec('virtinfo -ap')
|
3
14
|
|
@@ -3,14 +3,18 @@
|
|
3
3
|
# Purpose: Return Linux Standard Base information for the host.
|
4
4
|
#
|
5
5
|
# Resolution:
|
6
|
-
# Uses the
|
6
|
+
# Uses the lsbdistcodename key of the os structured fact, which
|
7
|
+
# itself uses the `lsb_release` system command.
|
7
8
|
#
|
8
9
|
# Caveats:
|
9
10
|
# Only works on Linux (and the kfreebsd derivative) systems.
|
10
|
-
# Requires the lsb_release program, which may not be installed by default.
|
11
|
+
# Requires the `lsb_release` program, which may not be installed by default.
|
11
12
|
# Also is as only as accurate as that program outputs.
|
12
13
|
|
13
14
|
Facter.add(:lsbdistcodename) do
|
14
|
-
confine
|
15
|
-
|
15
|
+
confine do
|
16
|
+
!Facter.value(:os)["lsb"].nil?
|
17
|
+
end
|
18
|
+
|
19
|
+
setcode { Facter.value("os")["lsb"]["distcodename"] }
|
16
20
|
end
|
@@ -3,23 +3,19 @@
|
|
3
3
|
# Purpose: Return Linux Standard Base information for the host.
|
4
4
|
#
|
5
5
|
# Resolution:
|
6
|
-
# Uses the
|
6
|
+
# Uses the lsbdistdescription key of the os structured fact, which itself
|
7
|
+
# uses the `lsb_release` system command.
|
7
8
|
#
|
8
9
|
# Caveats:
|
9
10
|
# Only works on Linux (and the kfreebsd derivative) systems.
|
10
|
-
# Requires the lsb_release program, which may not be installed by default.
|
11
|
+
# Requires the `lsb_release` program, which may not be installed by default.
|
11
12
|
# Also is as only as accurate as that program outputs.
|
13
|
+
#
|
12
14
|
|
13
15
|
Facter.add(:lsbdistdescription) do
|
14
|
-
confine :kernel => [ :linux, :"gnu/kfreebsd" ]
|
15
16
|
confine do
|
16
|
-
Facter
|
17
|
+
!Facter.value(:os)["lsb"].nil?
|
17
18
|
end
|
18
19
|
|
19
|
-
setcode
|
20
|
-
if output = Facter::Core::Execution.exec('lsb_release -d -s 2>/dev/null')
|
21
|
-
# the output may be quoted (at least it is on gentoo)
|
22
|
-
output.sub(/^"(.*)"$/,'\1')
|
23
|
-
end
|
24
|
-
end
|
20
|
+
setcode { Facter.value("os")["lsb"]["distdescription"] }
|
25
21
|
end
|
data/lib/facter/lsbdistid.rb
CHANGED
@@ -3,14 +3,18 @@
|
|
3
3
|
# Purpose: Return Linux Standard Base information for the host.
|
4
4
|
#
|
5
5
|
# Resolution:
|
6
|
-
# Uses the
|
6
|
+
# Uses the lsbdistid key of the os structured fact, which itself
|
7
|
+
# uses the `lsb_release` system command.
|
7
8
|
#
|
8
9
|
# Caveats:
|
9
10
|
# Only works on Linux (and the kfreebsd derivative) systems.
|
10
|
-
# Requires the lsb_release program, which may not be installed by default.
|
11
|
+
# Requires the `lsb_release` program, which may not be installed by default.
|
11
12
|
# Also is as only as accurate as that program outputs.
|
12
13
|
|
13
14
|
Facter.add(:lsbdistid) do
|
14
|
-
confine
|
15
|
-
|
15
|
+
confine do
|
16
|
+
!Facter.value(:os)["lsb"].nil?
|
17
|
+
end
|
18
|
+
|
19
|
+
setcode { Facter.value("os")["lsb"]["distid"] }
|
16
20
|
end
|
@@ -3,14 +3,18 @@
|
|
3
3
|
# Purpose: Return Linux Standard Base information for the host.
|
4
4
|
#
|
5
5
|
# Resolution:
|
6
|
-
# Uses the
|
6
|
+
# Uses the lsbdistrelease key of the os structured fact, which itself
|
7
|
+
# uses the `lsb_release` system command.
|
7
8
|
#
|
8
9
|
# Caveats:
|
9
10
|
# Only works on Linux (and the kfreebsd derivative) systems.
|
10
|
-
# Requires the lsb_release program, which may not be installed by default.
|
11
|
+
# Requires the `lsb_release` program, which may not be installed by default.
|
11
12
|
# Also is as only as accurate as that program outputs.
|
12
13
|
|
13
14
|
Facter.add(:lsbdistrelease) do
|
14
|
-
confine
|
15
|
-
|
15
|
+
confine do
|
16
|
+
!Facter.value(:os)["lsb"].nil?
|
17
|
+
end
|
18
|
+
|
19
|
+
setcode { Facter.value("os")["lsb"]["distrelease"] }
|
16
20
|
end
|
@@ -4,24 +4,19 @@
|
|
4
4
|
# from the lsbdistrelease fact.
|
5
5
|
#
|
6
6
|
# Resolution:
|
7
|
-
#
|
7
|
+
# Uses the lsbmajdistrelease key of the os structured fact, which itself
|
8
|
+
# parses the lsbdistrelease fact for numbers followed by a period and
|
8
9
|
# returns those, or just the lsbdistrelease fact if none were found.
|
9
10
|
#
|
10
11
|
# Caveats:
|
11
12
|
#
|
12
13
|
|
13
|
-
# lsbmajdistrelease.rb
|
14
|
-
#
|
15
14
|
require 'facter'
|
16
15
|
|
17
|
-
Facter.add(
|
18
|
-
confine
|
19
|
-
|
20
|
-
if /(\d*)\./i =~ Facter.value(:lsbdistrelease)
|
21
|
-
result=$1
|
22
|
-
else
|
23
|
-
result=Facter.value(:lsbdistrelease)
|
24
|
-
end
|
25
|
-
result
|
16
|
+
Facter.add(:lsbmajdistrelease) do
|
17
|
+
confine do
|
18
|
+
!Facter.value("os")["lsb"].nil?
|
26
19
|
end
|
20
|
+
|
21
|
+
setcode { Facter.value("os")["lsb"]["majdistrelease"] }
|
27
22
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Fact: lsbminordistrelease
|
2
|
+
#
|
3
|
+
# Purpose: Returns the minor version of the operation system version as gleaned
|
4
|
+
# from the lsbdistrelease fact.
|
5
|
+
#
|
6
|
+
# Resolution:
|
7
|
+
# Parses the lsbdistrelease fact for x.y and returns y. If y is not present,
|
8
|
+
# the fact is not present.
|
9
|
+
#
|
10
|
+
# For both values '1.2.3' and '1.2' of lsbdistrelease, lsbminordistrelease
|
11
|
+
# would return '2'. For the value '1', no fact would be set for
|
12
|
+
# lsbminordistrelease.
|
13
|
+
#
|
14
|
+
require 'facter'
|
15
|
+
|
16
|
+
Facter.add('lsbminordistrelease') do
|
17
|
+
confine do
|
18
|
+
!Facter.value("os")["lsb"].nil?
|
19
|
+
end
|
20
|
+
|
21
|
+
setcode { Facter.value("os")["lsb"]["minordistrelease"] }
|
22
|
+
end
|
data/lib/facter/lsbrelease.rb
CHANGED
@@ -3,14 +3,18 @@
|
|
3
3
|
# Purpose: Return Linux Standard Base information for the host.
|
4
4
|
#
|
5
5
|
# Resolution:
|
6
|
-
# Uses the
|
6
|
+
# Uses the lsbrelease key of the os structured fact, which itself
|
7
|
+
# uses the `lsb_release` system command.
|
7
8
|
#
|
8
9
|
# Caveats:
|
9
10
|
# Only works on Linux (and the kfreebsd derivative) systems.
|
10
|
-
# Requires the lsb_release program, which may not be installed by default.
|
11
|
+
# Requires the `lsb_release` program, which may not be installed by default.
|
11
12
|
# Also is as only as accurate as that program outputs.
|
12
13
|
|
13
14
|
Facter.add(:lsbrelease) do
|
14
|
-
confine
|
15
|
-
|
15
|
+
confine do
|
16
|
+
!Facter.value(:os)["lsb"].nil?
|
17
|
+
end
|
18
|
+
|
19
|
+
setcode { Facter.value("os")["lsb"]["release"] }
|
16
20
|
end
|
data/lib/facter/macaddress.rb
CHANGED
data/lib/facter/macosx.rb
CHANGED
data/lib/facter/manufacturer.rb
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
# Purpose: Return the hardware manufacturer information about the hardware.
|
4
4
|
#
|
5
5
|
# Resolution:
|
6
|
-
# On OpenBSD, queries sysctl values, via a util class.
|
7
|
-
# On SunOS Sparc, uses prtdiag via a util class.
|
6
|
+
# On OpenBSD, queries `sysctl` values, via a util class.
|
7
|
+
# On SunOS Sparc, uses `prtdiag` via a util class.
|
8
8
|
# On Windows, queries the system via a util class.
|
9
|
-
# Uses
|
9
|
+
# Uses `util/manufacturer.rb` for fallback parsing.
|
10
10
|
#
|
11
11
|
# Caveats:
|
12
12
|
#
|
data/lib/facter/memory.rb
CHANGED
@@ -3,15 +3,15 @@
|
|
3
3
|
# Purpose: Return information about memory and swap usage.
|
4
4
|
#
|
5
5
|
# Resolution:
|
6
|
-
# On Linuxes, uses Facter::Memory.meminfo_number from
|
7
|
-
#
|
8
|
-
# On AIX, parses
|
9
|
-
# On OpenBSD, it parses
|
10
|
-
# free memory, and
|
11
|
-
# On FreeBSD, it parses
|
6
|
+
# On Linuxes, uses `Facter::Memory.meminfo_number` from
|
7
|
+
# `facter/util/memory.rb`
|
8
|
+
# On AIX, parses `swap -l` for swap values only.
|
9
|
+
# On OpenBSD, it parses `swapctl -l` for swap values, `vmstat` via a module for
|
10
|
+
# free memory, and `sysctl hw.physmem` for maximum memory.
|
11
|
+
# On FreeBSD, it parses `swapinfo -k` for swap values, and parses `sysctl` for
|
12
12
|
# maximum memory.
|
13
|
-
# On Solaris, use
|
14
|
-
# memory, and again, the vmstat module for free memory.
|
13
|
+
# On Solaris, use `swap -l` for swap values, and parsing `prtconf` for maximum
|
14
|
+
# memory, and again, the `vmstat` module for free memory.
|
15
15
|
#
|
16
16
|
# Caveats:
|
17
17
|
# Some BSD platforms aren't covered at all. AIX is missing memory values.
|