facter 2.1.0 → 2.2.0

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.

Files changed (139) hide show
  1. data/COMMITTERS.md +25 -34
  2. data/CONTRIBUTING.md +27 -5
  3. data/README.md +32 -0
  4. data/ext/build_defaults.yaml +1 -1
  5. data/ext/debian/control +3 -2
  6. data/ext/osx/file_mapping.yaml +5 -0
  7. data/ext/redhat/facter.spec.erb +4 -1
  8. data/lib/facter/Cfkey.rb +2 -2
  9. data/lib/facter/architecture.rb +2 -2
  10. data/lib/facter/augeasversion.rb +2 -2
  11. data/lib/facter/blockdevices.rb +12 -12
  12. data/lib/facter/dhcp_servers.rb +4 -4
  13. data/lib/facter/domain.rb +4 -4
  14. data/lib/facter/ec2.rb +17 -0
  15. data/lib/facter/ec2/rest.rb +2 -2
  16. data/lib/facter/facterversion.rb +2 -2
  17. data/lib/facter/filesystems.rb +10 -3
  18. data/lib/facter/fqdn.rb +1 -1
  19. data/lib/facter/gid.rb +16 -0
  20. data/lib/facter/hardwareisa.rb +3 -3
  21. data/lib/facter/hardwaremodel.rb +3 -3
  22. data/lib/facter/hostname.rb +1 -1
  23. data/lib/facter/id.rb +4 -4
  24. data/lib/facter/interfaces.rb +3 -0
  25. data/lib/facter/ipaddress6.rb +9 -9
  26. data/lib/facter/kernel.rb +2 -2
  27. data/lib/facter/kernelmajversion.rb +2 -2
  28. data/lib/facter/kernelrelease.rb +4 -4
  29. data/lib/facter/kernelversion.rb +3 -3
  30. data/lib/facter/ldom.rb +11 -0
  31. data/lib/facter/lsbdistcodename.rb +8 -4
  32. data/lib/facter/lsbdistdescription.rb +6 -10
  33. data/lib/facter/lsbdistid.rb +8 -4
  34. data/lib/facter/lsbdistrelease.rb +8 -4
  35. data/lib/facter/lsbmajdistrelease.rb +7 -12
  36. data/lib/facter/lsbminordistrelease.rb +22 -0
  37. data/lib/facter/lsbrelease.rb +8 -4
  38. data/lib/facter/macaddress.rb +1 -0
  39. data/lib/facter/macosx.rb +1 -1
  40. data/lib/facter/manufacturer.rb +3 -3
  41. data/lib/facter/memory.rb +8 -8
  42. data/lib/facter/netmask.rb +2 -1
  43. data/lib/facter/network.rb +3 -3
  44. data/lib/facter/operatingsystem.rb +9 -126
  45. data/lib/facter/operatingsystem/base.rb +61 -0
  46. data/lib/facter/operatingsystem/cumuluslinux.rb +27 -0
  47. data/lib/facter/operatingsystem/implementation.rb +30 -0
  48. data/lib/facter/operatingsystem/linux.rb +467 -0
  49. data/lib/facter/operatingsystem/sunos.rb +54 -0
  50. data/lib/facter/operatingsystem/vmkernel.rb +11 -0
  51. data/lib/facter/operatingsystem/windows.rb +37 -0
  52. data/lib/facter/operatingsystemmajrelease.rb +14 -33
  53. data/lib/facter/operatingsystemrelease.rb +14 -235
  54. data/lib/facter/os.rb +69 -0
  55. data/lib/facter/osfamily.rb +4 -23
  56. data/lib/facter/partitions.rb +4 -3
  57. data/lib/facter/path.rb +2 -2
  58. data/lib/facter/physicalprocessorcount.rb +10 -74
  59. data/lib/facter/processor.rb +13 -129
  60. data/lib/facter/processors.rb +60 -0
  61. data/lib/facter/processors/os.rb +234 -0
  62. data/lib/facter/ps.rb +5 -4
  63. data/lib/facter/puppetversion.rb +1 -1
  64. data/lib/facter/rackspace.rb +34 -0
  65. data/lib/facter/rubysitedir.rb +3 -0
  66. data/lib/facter/rubyversion.rb +2 -2
  67. data/lib/facter/selinux.rb +57 -2
  68. data/lib/facter/ssh.rb +1 -0
  69. data/lib/facter/system_uptime.rb +42 -0
  70. data/lib/facter/timezone.rb +1 -1
  71. data/lib/facter/uptime.rb +5 -23
  72. data/lib/facter/uptime_days.rb +4 -6
  73. data/lib/facter/uptime_hours.rb +4 -6
  74. data/lib/facter/uptime_seconds.rb +5 -9
  75. data/lib/facter/util/formatter.rb +1 -1
  76. data/lib/facter/util/manufacturer.rb +1 -1
  77. data/lib/facter/util/partitions.rb +3 -1
  78. data/lib/facter/util/partitions/linux.rb +1 -1
  79. data/lib/facter/util/partitions/openbsd.rb +35 -0
  80. data/lib/facter/util/uptime.rb +4 -3
  81. data/lib/facter/util/virtual.rb +3 -1
  82. data/lib/facter/util/xendomains.rb +12 -3
  83. data/lib/facter/version.rb +1 -1
  84. data/lib/facter/virtual.rb +24 -23
  85. data/lib/facter/vlans.rb +1 -1
  86. data/lib/facter/xendomains.rb +1 -1
  87. data/lib/facter/zfs_version.rb +6 -2
  88. data/lib/facter/zones.rb +6 -5
  89. data/lib/facter/zpool_version.rb +1 -1
  90. data/spec/fixtures/cpuinfo/amd64dual-grep +2 -0
  91. data/spec/fixtures/cpuinfo/amd64twentyfour-grep +24 -0
  92. data/spec/fixtures/cpuinfo/two_multicore-grep +4 -0
  93. data/spec/fixtures/cpuinfo/two_singlecore-grep +2 -0
  94. data/spec/fixtures/unit/processors/os/darwin-system-profiler +287 -0
  95. data/spec/fixtures/unit/zfs_version/zfs_new +61 -0
  96. data/spec/fixtures/unit/zfs_version/zfs_old +43 -0
  97. data/spec/fixtures/unit/zfs_version/zfsonlinux_0.6.1 +13 -0
  98. data/spec/fixtures/unit/zpool_version/zfsonlinux_0.6.1 +48 -0
  99. data/spec/unit/ec2/rest_spec.rb +6 -6
  100. data/spec/unit/gid_spec.rb +22 -0
  101. data/spec/unit/hardwaremodel_spec.rb +2 -0
  102. data/spec/unit/lsbdistcodename_spec.rb +22 -17
  103. data/spec/unit/lsbdistdescription_spec.rb +22 -17
  104. data/spec/unit/lsbdistid_spec.rb +23 -18
  105. data/spec/unit/lsbdistrelease_spec.rb +22 -17
  106. data/spec/unit/lsbmajdistrelease_spec.rb +23 -6
  107. data/spec/unit/lsbminordistrelease_spec.rb +31 -0
  108. data/spec/unit/lsbrelease_spec.rb +22 -17
  109. data/spec/unit/macaddress_spec.rb +3 -0
  110. data/spec/unit/operatingsystem/base_spec.rb +76 -0
  111. data/spec/unit/operatingsystem/cumuluslinux_spec.rb +40 -0
  112. data/spec/unit/operatingsystem/implementation_spec.rb +49 -0
  113. data/spec/unit/operatingsystem/linux_spec.rb +538 -0
  114. data/spec/unit/operatingsystem/sunos_spec.rb +144 -0
  115. data/spec/unit/operatingsystem/vmkernel_spec.rb +13 -0
  116. data/spec/unit/operatingsystem/windows_spec.rb +68 -0
  117. data/spec/unit/operatingsystem_spec.rb +10 -153
  118. data/spec/unit/operatingsystemmajrelease_spec.rb +14 -31
  119. data/spec/unit/operatingsystemrelease_spec.rb +13 -229
  120. data/spec/unit/os_spec.rb +131 -0
  121. data/spec/unit/osfamily_spec.rb +9 -54
  122. data/spec/unit/partitions_spec.rb +41 -3
  123. data/spec/unit/physicalprocessorcount_spec.rb +6 -78
  124. data/spec/unit/processor_spec.rb +18 -381
  125. data/spec/unit/processors/os_spec.rb +446 -0
  126. data/spec/unit/processors_spec.rb +203 -0
  127. data/spec/unit/rackspace_spec.rb +40 -0
  128. data/spec/unit/system_uptime_spec.rb +80 -0
  129. data/spec/unit/util/formatter_spec.rb +5 -0
  130. data/spec/unit/util/macaddress_spec.rb +2 -0
  131. data/spec/unit/util/processor_spec.rb +120 -0
  132. data/spec/unit/util/uptime_spec.rb +3 -4
  133. data/spec/unit/util/virtual_spec.rb +8 -0
  134. data/spec/unit/util/xendomains_spec.rb +54 -9
  135. data/spec/unit/virtual_spec.rb +8 -1
  136. data/spec/unit/zfs_version_spec.rb +20 -8
  137. data/spec/unit/zpool_version_spec.rb +5 -0
  138. metadata +652 -589
  139. checksums.yaml +0 -7
@@ -1,9 +1,16 @@
1
+ # Fact: filesystems
1
2
  #
2
- # filesystems.rb
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
- # This fact provides an alphabetic list of usable file systems that can
5
- # be used for block devices like hard drives, media cards and so on ...
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
@@ -1,6 +1,6 @@
1
1
  # Fact: fqdn
2
2
  #
3
- # Purpose: Returns the fully qualified domain name of the host.
3
+ # Purpose: Returns the fully-qualified domain name of the host.
4
4
  #
5
5
  # Resolution: Simply joins the hostname fact with the domain name fact.
6
6
  #
@@ -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
@@ -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 "uname -p"
8
- # On HP-UX, "uname -m" gives us the same information.
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 linuxes return unknown to uname -p with relative ease.
11
+ # Some Linuxes return unknown to `uname -p` with relative ease.
12
12
  #
13
13
 
14
14
  Facter.add(:hardwareisa) do
@@ -4,9 +4,9 @@
4
4
  # Returns the hardware model of the system.
5
5
  #
6
6
  # Resolution:
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.
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
  #
@@ -3,7 +3,7 @@
3
3
  # Purpose: Return the system's short hostname.
4
4
  #
5
5
  # Resolution:
6
- # On all system bar Darwin, parses the output of the "hostname" system command
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.
@@ -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 id.
4
+ # running user ID.
5
5
  #
6
6
  # Resolution:
7
- # On all Unixes bar Solaris, just returns "whoami".
8
- # On Solaris, parses the output of the "id" command to grab the username, as
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
  #
@@ -1,6 +1,9 @@
1
1
  # Fact: interfaces
2
2
  #
3
3
  # Purpose:
4
+ # Generates the following facts on supported platforms: `<interface>_ipaddress`,
5
+ # `<interface>_ipaddress6`, `<interface>_macaddress`, `<interface>_netmask`,
6
+ # and `<interface>_mtu`.
4
7
  #
5
8
  # Resolution:
6
9
  #
@@ -3,15 +3,15 @@
3
3
  # Purpose: Returns the "main" IPv6 IP address of a system.
4
4
  #
5
5
  # Resolution:
6
- # OS dependant 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 routeable interface. Guessing
10
- # an interface is currently only possible with BSD type systems
11
- # to many assumptions have to be made on other platforms to make
12
- # this work with the current code. Most code ported or modeled
13
- # after the ipaddress fact for the sake of similar functionality
14
- # and familiar mechanics.
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
  #
@@ -3,8 +3,8 @@
3
3
  # Purpose: Returns the operating system's name.
4
4
  #
5
5
  # Resolution:
6
- # Uses Ruby's rbconfig to find host_os, if that is a Windows derivative, the
7
- # returns 'windows', otherwise returns "uname -s" verbatim.
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 2 elements of the kernel version as delimited by periods.
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
  #
@@ -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 "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.
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
  #
@@ -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 "uname -v".
7
- # Otherwise returns the 'kernerlversion' fact up to the first '-'. This may be
8
- # the entire 'kernelversion' fact in many cases.
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
  #
@@ -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 lsb_release system command
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 :kernel => [ :linux, :"gnu/kfreebsd" ]
15
- setcode 'lsb_release -c -s 2>/dev/null'
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 lsb_release system command
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::Core::Execution.which("lsb_release")
17
+ !Facter.value(:os)["lsb"].nil?
17
18
  end
18
19
 
19
- setcode do
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
@@ -3,14 +3,18 @@
3
3
  # Purpose: Return Linux Standard Base information for the host.
4
4
  #
5
5
  # Resolution:
6
- # Uses the lsb_release system command
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 :kernel => [ :linux, :"gnu/kfreebsd" ]
15
- setcode 'lsb_release -i -s 2>/dev/null'
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 lsb_release system command
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 :kernel => [ :linux, :"gnu/kfreebsd" ]
15
- setcode 'lsb_release -r -s 2>/dev/null'
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
- # Parses the lsbdistrelease fact for numbers followed by a period and
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("lsbmajdistrelease") do
18
- confine :kernel => %w{Linux GNU/kFreeBSD}
19
- setcode do
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
@@ -3,14 +3,18 @@
3
3
  # Purpose: Return Linux Standard Base information for the host.
4
4
  #
5
5
  # Resolution:
6
- # Uses the lsb_release system command
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 :kernel => [ :linux, :"gnu/kfreebsd" ]
15
- setcode 'lsb_release -v -s 2>/dev/null'
15
+ confine do
16
+ !Facter.value(:os)["lsb"].nil?
17
+ end
18
+
19
+ setcode { Facter.value("os")["lsb"]["release"] }
16
20
  end
@@ -1,6 +1,7 @@
1
1
  # Fact: macaddress
2
2
  #
3
3
  # Purpose:
4
+ # Returns the MAC address of the primary network interface.
4
5
  #
5
6
  # Resolution:
6
7
  #
@@ -6,7 +6,7 @@
6
6
  #
7
7
  # Resolution:
8
8
  # Uses util/macosx.rb to do the fact reconnaissance, then outputs them
9
- # preceded by 'sp_'
9
+ # preceded by `sp_`
10
10
  #
11
11
  # Caveats:
12
12
  #
@@ -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 the 'util/manufacturer.rb' for fallback parsing.
9
+ # Uses `util/manufacturer.rb` for fallback parsing.
10
10
  #
11
11
  # Caveats:
12
12
  #
@@ -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
- # '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
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 "swap -l" for swap values, and parsing prtconf for maximum
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.