facter 4.0.31 → 4.0.36

Sign up to get free protection for your applications and to get access to all the features.
Files changed (271) hide show
  1. checksums.yaml +4 -4
  2. data/lib/facter/custom_facts/util/directory_loader.rb +13 -1
  3. data/lib/facter/fact_groups.conf +140 -1
  4. data/lib/facter/facts/aix/disks.rb +17 -2
  5. data/lib/facter/facts/aix/networking/scope6.rb +3 -1
  6. data/lib/facter/facts/aix/scope6_interfaces.rb +0 -2
  7. data/lib/facter/facts/aix/serialnumber.rb +20 -0
  8. data/lib/facter/facts/aix/ssh.rb +3 -1
  9. data/lib/facter/facts/aix/sshalgorithmkey.rb +17 -0
  10. data/lib/facter/facts/aix/sshfp_algorithm.rb +20 -0
  11. data/lib/facter/facts/bsd/load_averages.rb +1 -1
  12. data/lib/facter/facts/debian/os/distro/release.rb +6 -1
  13. data/lib/facter/facts/freebsd/augeas/version.rb +19 -0
  14. data/lib/facter/facts/freebsd/dmi/bios/release_date.rb +19 -0
  15. data/lib/facter/facts/freebsd/dmi/bios/vendor.rb +19 -0
  16. data/lib/facter/facts/freebsd/dmi/bios/version.rb +19 -0
  17. data/lib/facter/facts/freebsd/dmi/manufacturer.rb +17 -0
  18. data/lib/facter/facts/freebsd/dmi/product/name.rb +19 -0
  19. data/lib/facter/facts/freebsd/dmi/product/serial_number.rb +19 -0
  20. data/lib/facter/facts/freebsd/dmi/product/uuid.rb +19 -0
  21. data/lib/facter/facts/freebsd/facterversion.rb +14 -0
  22. data/lib/facter/facts/freebsd/identity/gid.rb +16 -0
  23. data/lib/facter/facts/{solaris/solaris_zones/current.rb → freebsd/identity/group.rb} +6 -6
  24. data/lib/facter/facts/freebsd/identity/privileged.rb +16 -0
  25. data/lib/facter/facts/freebsd/identity/uid.rb +16 -0
  26. data/lib/facter/facts/freebsd/identity/user.rb +17 -0
  27. data/lib/facter/facts/freebsd/kernel.rb +14 -0
  28. data/lib/facter/facts/freebsd/kernelrelease.rb +14 -0
  29. data/lib/facter/facts/freebsd/memory/swap/available.rb +21 -0
  30. data/lib/facter/facts/freebsd/memory/swap/available_bytes.rb +20 -0
  31. data/lib/facter/facts/freebsd/memory/swap/capacity.rb +18 -0
  32. data/lib/facter/facts/freebsd/memory/swap/encrypted.rb +19 -0
  33. data/lib/facter/facts/freebsd/memory/swap/total.rb +21 -0
  34. data/lib/facter/facts/freebsd/memory/swap/total_bytes.rb +20 -0
  35. data/lib/facter/facts/freebsd/memory/swap/used.rb +20 -0
  36. data/lib/facter/facts/freebsd/memory/swap/used_bytes.rb +18 -0
  37. data/lib/facter/facts/freebsd/memory/system/available.rb +21 -0
  38. data/lib/facter/facts/freebsd/memory/system/available_bytes.rb +20 -0
  39. data/lib/facter/facts/freebsd/memory/system/capacity.rb +18 -0
  40. data/lib/facter/facts/freebsd/memory/system/total.rb +21 -0
  41. data/lib/facter/facts/freebsd/memory/system/total_bytes.rb +20 -0
  42. data/lib/facter/facts/freebsd/memory/system/used.rb +20 -0
  43. data/lib/facter/facts/freebsd/memory/system/used_bytes.rb +18 -0
  44. data/lib/facter/facts/freebsd/mountpoints.rb +21 -0
  45. data/lib/facter/facts/freebsd/netmask6_interfaces.rb +20 -0
  46. data/lib/facter/facts/freebsd/netmask_interfaces.rb +20 -0
  47. data/lib/facter/facts/freebsd/network6_interfaces.rb +20 -0
  48. data/lib/facter/facts/freebsd/network_interfaces.rb +20 -0
  49. data/lib/facter/facts/freebsd/networking/dhcp.rb +17 -0
  50. data/lib/facter/facts/freebsd/networking/domain.rb +18 -0
  51. data/lib/facter/facts/freebsd/networking/fqdn.rb +18 -0
  52. data/lib/facter/facts/freebsd/networking/hostname.rb +18 -0
  53. data/lib/facter/facts/freebsd/networking/interfaces.rb +17 -0
  54. data/lib/facter/facts/freebsd/networking/ip.rb +18 -0
  55. data/lib/facter/facts/freebsd/networking/ip6.rb +18 -0
  56. data/lib/facter/facts/freebsd/networking/mac.rb +18 -0
  57. data/lib/facter/facts/freebsd/networking/mtu.rb +17 -0
  58. data/lib/facter/facts/freebsd/networking/netmask.rb +18 -0
  59. data/lib/facter/facts/freebsd/networking/netmask6.rb +18 -0
  60. data/lib/facter/facts/freebsd/networking/network.rb +18 -0
  61. data/lib/facter/facts/freebsd/networking/network6.rb +18 -0
  62. data/lib/facter/facts/freebsd/networking/primary.rb +17 -0
  63. data/lib/facter/facts/freebsd/networking/scope6.rb +17 -0
  64. data/lib/facter/facts/freebsd/os/architecture.rb +18 -0
  65. data/lib/facter/facts/freebsd/os/hardware.rb +18 -0
  66. data/lib/facter/facts/freebsd/os/name.rb +18 -0
  67. data/lib/facter/facts/{bsd/bsd_example_fact.rb → freebsd/path.rb} +5 -4
  68. data/lib/facter/facts/freebsd/processors/isa.rb +17 -0
  69. data/lib/facter/facts/freebsd/puppet_version.rb +15 -0
  70. data/lib/facter/facts/freebsd/ruby/platform.rb +18 -0
  71. data/lib/facter/facts/freebsd/ruby/sitedir.rb +18 -0
  72. data/lib/facter/facts/freebsd/ruby/version.rb +18 -0
  73. data/lib/facter/facts/freebsd/ssh.rb +26 -0
  74. data/lib/facter/facts/freebsd/sshalgorithmkey.rb +17 -0
  75. data/lib/facter/facts/freebsd/sshfp_algorithm.rb +20 -0
  76. data/lib/facter/facts/freebsd/system_uptime/days.rb +18 -0
  77. data/lib/facter/facts/freebsd/system_uptime/hours.rb +18 -0
  78. data/lib/facter/facts/freebsd/system_uptime/seconds.rb +18 -0
  79. data/lib/facter/facts/freebsd/system_uptime/uptime.rb +18 -0
  80. data/lib/facter/facts/freebsd/timezone.rb +15 -0
  81. data/lib/facter/facts/freebsd/zfs_featurenumbers.rb +14 -0
  82. data/lib/facter/facts/freebsd/zfs_version.rb +14 -0
  83. data/lib/facter/facts/freebsd/zpool_featureflags.rb +14 -0
  84. data/lib/facter/facts/freebsd/zpool_featurenumbers.rb +14 -0
  85. data/lib/facter/facts/freebsd/zpool_version.rb +14 -0
  86. data/lib/facter/facts/linux/disks.rb +20 -1
  87. data/lib/facter/facts/linux/dmi/board/asset_tag.rb +19 -0
  88. data/lib/facter/facts/linux/ec2_metadata.rb +5 -3
  89. data/lib/facter/facts/linux/ec2_userdata.rb +5 -3
  90. data/lib/facter/facts/linux/gce.rb +16 -0
  91. data/lib/facter/facts/linux/is_virtual.rb +1 -3
  92. data/lib/facter/facts/linux/mountpoints.rb +1 -1
  93. data/lib/facter/facts/linux/networking/scope6.rb +3 -1
  94. data/lib/facter/facts/linux/partitions.rb +1 -1
  95. data/lib/facter/facts/linux/processors/speed.rb +17 -0
  96. data/lib/facter/facts/linux/scope6_interfaces.rb +1 -2
  97. data/lib/facter/facts/linux/ssh.rb +19 -9
  98. data/lib/facter/facts/linux/sshfp_algorithm.rb +1 -1
  99. data/lib/facter/facts/linux/system_uptime/days.rb +7 -1
  100. data/lib/facter/facts/linux/system_uptime/hours.rb +7 -1
  101. data/lib/facter/facts/linux/system_uptime/seconds.rb +7 -1
  102. data/lib/facter/facts/linux/system_uptime/uptime.rb +7 -1
  103. data/lib/facter/facts/linux/virtual.rb +17 -0
  104. data/lib/facter/facts/linux/xen.rb +28 -0
  105. data/lib/facter/facts/macosx/dhcp_servers.rb +2 -2
  106. data/lib/facter/facts/macosx/interfaces.rb +1 -1
  107. data/lib/facter/facts/macosx/ipaddress6_interfaces.rb +1 -1
  108. data/lib/facter/facts/macosx/ipaddress_interfaces.rb +1 -1
  109. data/lib/facter/facts/macosx/macaddress_interfaces.rb +1 -1
  110. data/lib/facter/facts/macosx/mtu_interfaces.rb +1 -1
  111. data/lib/facter/facts/macosx/netmask6_interfaces.rb +1 -1
  112. data/lib/facter/facts/macosx/netmask_interfaces.rb +1 -1
  113. data/lib/facter/facts/macosx/network6_interfaces.rb +1 -1
  114. data/lib/facter/facts/macosx/network_interfaces.rb +1 -1
  115. data/lib/facter/facts/macosx/networking/dhcp.rb +1 -1
  116. data/lib/facter/facts/macosx/networking/interfaces.rb +1 -1
  117. data/lib/facter/facts/macosx/networking/ip.rb +1 -1
  118. data/lib/facter/facts/macosx/networking/ip6.rb +1 -1
  119. data/lib/facter/facts/macosx/networking/mac.rb +1 -1
  120. data/lib/facter/facts/macosx/networking/mtu.rb +1 -1
  121. data/lib/facter/facts/macosx/networking/netmask.rb +1 -1
  122. data/lib/facter/facts/macosx/networking/netmask6.rb +1 -1
  123. data/lib/facter/facts/macosx/networking/network.rb +1 -1
  124. data/lib/facter/facts/macosx/networking/network6.rb +1 -1
  125. data/lib/facter/facts/macosx/networking/primary.rb +1 -1
  126. data/lib/facter/facts/macosx/networking/scope6.rb +4 -2
  127. data/lib/facter/facts/macosx/scope6_interfaces.rb +1 -3
  128. data/lib/facter/facts/macosx/ssh.rb +19 -11
  129. data/lib/facter/facts/macosx/sshfp_algorithm.rb +1 -1
  130. data/lib/facter/facts/macosx/virtual.rb +1 -1
  131. data/lib/facter/facts/solaris/current_zone.rb +16 -0
  132. data/lib/facter/facts/solaris/disks.rb +33 -0
  133. data/lib/facter/facts/solaris/dmi/bios/release_date.rb +24 -0
  134. data/lib/facter/facts/solaris/dmi/bios/vendor.rb +24 -0
  135. data/lib/facter/facts/solaris/dmi/bios/version.rb +24 -0
  136. data/lib/facter/facts/solaris/dmi/chassis/asset_tag.rb +24 -0
  137. data/lib/facter/facts/solaris/dmi/chassis/type.rb +24 -0
  138. data/lib/facter/facts/solaris/dmi/manufacturer.rb +25 -0
  139. data/lib/facter/facts/solaris/dmi/product/name.rb +27 -0
  140. data/lib/facter/facts/solaris/dmi/product/serial_number.rb +27 -0
  141. data/lib/facter/facts/solaris/dmi/product/uuid.rb +24 -0
  142. data/lib/facter/facts/solaris/hypervisors/ldom.rb +24 -0
  143. data/lib/facter/facts/solaris/hypervisors/zone.rb +39 -0
  144. data/lib/facter/facts/solaris/is_virtual.rb +64 -0
  145. data/lib/facter/facts/solaris/kernelmajversion.rb +1 -1
  146. data/lib/facter/facts/solaris/ldom.rb +35 -0
  147. data/lib/facter/facts/solaris/load_averages.rb +14 -0
  148. data/lib/facter/facts/solaris/memory/swap/available.rb +22 -0
  149. data/lib/facter/facts/solaris/memory/swap/available_bytes.rb +22 -0
  150. data/lib/facter/facts/solaris/memory/swap/capacity.rb +20 -0
  151. data/lib/facter/facts/solaris/memory/swap/total.rb +22 -0
  152. data/lib/facter/facts/solaris/memory/swap/total_bytes.rb +22 -0
  153. data/lib/facter/facts/solaris/memory/swap/used.rb +21 -0
  154. data/lib/facter/facts/solaris/memory/swap/used_bytes.rb +19 -0
  155. data/lib/facter/facts/solaris/memory/system/available.rb +22 -0
  156. data/lib/facter/facts/solaris/memory/system/available_bytes.rb +22 -0
  157. data/lib/facter/facts/solaris/memory/system/capacity.rb +20 -0
  158. data/lib/facter/facts/solaris/memory/system/total.rb +22 -0
  159. data/lib/facter/facts/solaris/memory/system/total_bytes.rb +22 -0
  160. data/lib/facter/facts/solaris/memory/system/used.rb +21 -0
  161. data/lib/facter/facts/solaris/memory/system/used_bytes.rb +19 -0
  162. data/lib/facter/facts/solaris/mountpoints.rb +1 -1
  163. data/lib/facter/facts/solaris/os/release.rb +3 -3
  164. data/lib/facter/facts/solaris/ssh.rb +19 -9
  165. data/lib/facter/facts/solaris/sshalgorithmkey.rb +17 -0
  166. data/lib/facter/facts/solaris/sshfp_algorithm.rb +20 -0
  167. data/lib/facter/facts/solaris/virtual.rb +60 -0
  168. data/lib/facter/facts/solaris/zfs_featurenumbers.rb +1 -1
  169. data/lib/facter/facts/solaris/zfs_version.rb +1 -1
  170. data/lib/facter/facts/solaris/zones.rb +60 -0
  171. data/lib/facter/facts/solaris/zpool_featureflags.rb +1 -1
  172. data/lib/facter/facts/solaris/zpool_featurenumbers.rb +1 -1
  173. data/lib/facter/facts/solaris/zpool_version.rb +1 -1
  174. data/lib/facter/facts/windows/dhcp_servers.rb +2 -2
  175. data/lib/facter/facts/windows/ec2_metadata.rb +5 -3
  176. data/lib/facter/facts/windows/ec2_userdata.rb +5 -3
  177. data/lib/facter/facts/windows/gce.rb +16 -0
  178. data/lib/facter/facts/windows/interfaces.rb +1 -1
  179. data/lib/facter/facts/windows/ipaddress6_interfaces.rb +1 -1
  180. data/lib/facter/facts/windows/ipaddress_interfaces.rb +1 -1
  181. data/lib/facter/facts/windows/macaddress_interfaces.rb +1 -1
  182. data/lib/facter/facts/windows/mtu_interfaces.rb +1 -1
  183. data/lib/facter/facts/windows/netmask6_interfaces.rb +1 -1
  184. data/lib/facter/facts/windows/netmask_interfaces.rb +1 -1
  185. data/lib/facter/facts/windows/network6_interfaces.rb +1 -1
  186. data/lib/facter/facts/windows/network_interfaces.rb +1 -1
  187. data/lib/facter/facts/windows/networking/dhcp.rb +1 -1
  188. data/lib/facter/facts/windows/networking/domain.rb +1 -1
  189. data/lib/facter/facts/windows/networking/fqdn.rb +1 -1
  190. data/lib/facter/facts/windows/networking/interfaces.rb +1 -1
  191. data/lib/facter/facts/windows/networking/ip.rb +1 -1
  192. data/lib/facter/facts/windows/networking/ip6.rb +1 -1
  193. data/lib/facter/facts/windows/networking/mac.rb +1 -1
  194. data/lib/facter/facts/windows/networking/mtu.rb +1 -1
  195. data/lib/facter/facts/windows/networking/netmask.rb +1 -1
  196. data/lib/facter/facts/windows/networking/netmask6.rb +1 -1
  197. data/lib/facter/facts/windows/networking/network.rb +1 -1
  198. data/lib/facter/facts/windows/networking/network6.rb +1 -1
  199. data/lib/facter/facts/windows/networking/primary.rb +1 -1
  200. data/lib/facter/facts/windows/networking/scope6.rb +4 -2
  201. data/lib/facter/facts/windows/scope6_interfaces.rb +1 -1
  202. data/lib/facter/facts/windows/sshalgorithmkey.rb +22 -0
  203. data/lib/facter/facts/windows/sshfp_algorithm.rb +25 -0
  204. data/lib/facter/facts_utils/facts_utils.rb +2 -0
  205. data/lib/facter/framework/cli/cli.rb +16 -4
  206. data/lib/facter/framework/config/fact_groups.rb +13 -0
  207. data/lib/facter/framework/core/fact/internal/core_fact.rb +2 -0
  208. data/lib/facter/framework/core/fact/internal/internal_fact_manager.rb +10 -25
  209. data/lib/facter/framework/core/fact_filter.rb +13 -0
  210. data/lib/facter/framework/core/fact_loaders/fact_loader.rb +24 -1
  211. data/lib/facter/framework/detector/os_detector.rb +5 -1
  212. data/lib/facter/framework/formatters/legacy_fact_formatter.rb +8 -1
  213. data/lib/facter/framework/formatters/yaml_fact_formatter.rb +1 -1
  214. data/lib/facter/os_hierarchy.json +6 -7
  215. data/lib/facter/resolvers/aix/serialnumber.rb +37 -0
  216. data/lib/facter/resolvers/augeas_resolver.rb +19 -2
  217. data/lib/facter/resolvers/base_resolver.rb +1 -1
  218. data/lib/facter/resolvers/bsd/ffi/ffi_helper.rb +0 -10
  219. data/lib/facter/resolvers/dmi_resolver.rb +4 -3
  220. data/lib/facter/resolvers/ec2.rb +4 -18
  221. data/lib/facter/resolvers/filesystems_resolver.rb +1 -1
  222. data/lib/facter/resolvers/freebsd/dmi_resolver.rb +38 -0
  223. data/lib/facter/resolvers/freebsd/ffi/ffi_helper.rb +19 -0
  224. data/lib/facter/resolvers/freebsd/swap_memory_resolver.rb +39 -0
  225. data/lib/facter/resolvers/freebsd/system_memory_resolver.rb +41 -0
  226. data/lib/facter/resolvers/gce.rb +54 -0
  227. data/lib/facter/resolvers/linux/docker_uptime.rb +45 -0
  228. data/lib/facter/resolvers/{load_averages_resolver.rb → linux/load_averages.rb} +0 -1
  229. data/lib/facter/resolvers/load_averages.rb +26 -0
  230. data/lib/facter/resolvers/lspci.rb +2 -0
  231. data/lib/facter/resolvers/memory_resolver.rb +8 -1
  232. data/lib/facter/resolvers/mountpoints_resolver.rb +42 -44
  233. data/lib/facter/resolvers/networking_linux_resolver.rb +16 -1
  234. data/lib/facter/resolvers/networking_resolver.rb +106 -0
  235. data/lib/facter/resolvers/os_release_resolver.rb +1 -1
  236. data/lib/facter/resolvers/processors_resolver.rb +24 -2
  237. data/lib/facter/resolvers/redhat_release_resolver.rb +4 -3
  238. data/lib/facter/resolvers/solaris/disks.rb +51 -0
  239. data/lib/facter/resolvers/solaris/dmi.rb +57 -0
  240. data/lib/facter/resolvers/solaris/dmi_sparc.rb +47 -0
  241. data/lib/facter/resolvers/solaris/ffi/ffi.rb +5 -0
  242. data/lib/facter/resolvers/solaris/{filesystems_resolver.rb → filesystems.rb} +0 -0
  243. data/lib/facter/resolvers/solaris/{ipaddress_resolver.rb → ipaddress.rb} +0 -0
  244. data/lib/facter/resolvers/solaris/ldom.rb +70 -0
  245. data/lib/facter/resolvers/solaris/memory.rb +93 -0
  246. data/lib/facter/resolvers/solaris/{networking_resolver.rb → networking.rb} +2 -6
  247. data/lib/facter/resolvers/solaris/os_release.rb +44 -0
  248. data/lib/facter/resolvers/solaris/zone.rb +51 -0
  249. data/lib/facter/resolvers/solaris/zone_name.rb +31 -0
  250. data/lib/facter/resolvers/uptime_resolver.rb +1 -27
  251. data/lib/facter/resolvers/utils/ffi/load_averages.rb +27 -0
  252. data/lib/facter/resolvers/utils/http.rb +68 -0
  253. data/lib/facter/resolvers/utils/networking.rb +2 -0
  254. data/lib/facter/resolvers/utils/uptime_helper.rb +32 -0
  255. data/lib/facter/resolvers/windows/ffi/ffi.rb +1 -1
  256. data/lib/facter/resolvers/windows/networking_resolver.rb +100 -100
  257. data/lib/facter/resolvers/xen.rb +28 -0
  258. data/lib/facter/resolvers/zfs.rb +32 -0
  259. data/lib/facter/resolvers/zpool.rb +34 -0
  260. data/lib/facter/version.rb +1 -1
  261. metadata +144 -18
  262. data/lib/facter/facts/freebsd/solaris_zones/current.rb +0 -15
  263. data/lib/facter/facts/freebsd/solaris_zones/zone.rb +0 -15
  264. data/lib/facter/facts/solaris/solaris_zones/zone.rb +0 -62
  265. data/lib/facter/resolvers/bsd/load_averages_resolver.rb +0 -26
  266. data/lib/facter/resolvers/macosx/networking_resolver.rb +0 -108
  267. data/lib/facter/resolvers/solaris/solaris_os_release_resolver.rb +0 -42
  268. data/lib/facter/resolvers/solaris/solaris_zone_name.rb +0 -28
  269. data/lib/facter/resolvers/solaris/zfs_resolver.rb +0 -34
  270. data/lib/facter/resolvers/solaris/zone_resolver.rb +0 -48
  271. data/lib/facter/resolvers/solaris/zpool_resolver.rb +0 -36
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58032c19dc544418cdd5bdc8598a48d6d8cc2b9c67f3ef3ac081fe98cf03ac6a
4
- data.tar.gz: db8bd43f5f28c4c7ea30d67c2ecb02367d398b70c2096fa5ee5f0319c2473640
3
+ metadata.gz: ceb625b0a349be8f5f574055b24aebd9860672ccdfc27224377a75255681b571
4
+ data.tar.gz: 1081225dee1a50781041d65599bc74fccf1552fe1ce75a9195f0aecd8608afb8
5
5
  SHA512:
6
- metadata.gz: 52a387b13db0d8064f5cfc7e968b1b8c65843098071e04b662ee76a5c57bbdf5cbcbc669230a30544007fecc648645553496e4ccf000eba81cf7dbb0e6103d90
7
- data.tar.gz: 61e0b00e59b79820c2ec91118c8bba3b3d692bc620807a29341e0cc2530565d574fd80648167547e55d556db145176ca78d126f2e8ff7f4093155c95534fe5a5
6
+ metadata.gz: 0c31f37ed2064c1683e9f56a5d252bab225e1af0c0df025d1621ef89551fefa6a0816cc3862d4c98ab2480a6e158f62b18bcf0d5ae9f2d75f22799297660ffc9
7
+ data.tar.gz: d6f071e0bf9bcdf01c460ea7ac45d0cb50459c4a40e663761cf7c58de0068b6c9e444cebedd5304a692317a960a8d1327accea35f6815b90076e4acc4ce2ec3b
@@ -35,6 +35,7 @@ module LegacyFacter
35
35
  def initialize(dir = LegacyFacter::Util::Config.external_facts_dirs, weight = EXTERNAL_FACT_WEIGHT)
36
36
  @directories = [dir].flatten
37
37
  @weight = weight
38
+ @log ||= Facter::Log.new(self)
38
39
  end
39
40
 
40
41
  # Load facts from files in fact directory using the relevant parser classes to
@@ -56,6 +57,8 @@ module LegacyFacter
56
57
  facts = []
57
58
  entries.each do |file|
58
59
  basename = File.basename(file)
60
+ next if file_blocked?(basename)
61
+
59
62
  if facts.find { |f| f.name == basename } && cm.group_cached?(basename)
60
63
  Facter.log_exception(Exception.new("Caching is enabled for group \"#{basename}\" while "\
61
64
  'there are at least two external facts files with the same filename'))
@@ -82,10 +85,11 @@ module LegacyFacter
82
85
  next if parser.nil?
83
86
 
84
87
  data = parser.results
88
+
85
89
  if data == false
86
90
  LegacyFacter.warn "Could not interpret fact file #{fact.file}"
87
91
  elsif (data == {}) || data.nil?
88
- LegacyFacter.warn "Fact file #{fact.file} was parsed but returned an empty data set"
92
+ @log.debug("Fact file #{fact.file} was parsed but no key=>value data was returned")
89
93
  else
90
94
  data.each do |p, v|
91
95
  collection.add(p, value: v, fact_type: :external,
@@ -107,6 +111,14 @@ module LegacyFacter
107
111
  def should_parse?(file)
108
112
  File.basename(file) !~ /^\./
109
113
  end
114
+
115
+ def file_blocked?(file)
116
+ if Facter::Options[:blocked_facts].include? file
117
+ Facter.debug("External fact file #{file} blocked.")
118
+ return true
119
+ end
120
+ false
121
+ end
110
122
  end
111
123
  end
112
124
  end
@@ -165,5 +165,144 @@
165
165
  "virtual",
166
166
  "is_virtual",
167
167
  "cloud"
168
+ ],
169
+ "legacy": [
170
+ "architecture",
171
+ "augeasversion",
172
+ "bios_release_date",
173
+ "bios_vendor",
174
+ "bios_version",
175
+ "blockdevice_*_model",
176
+ "blockdevice_*_size",
177
+ "blockdevice_*_vendor",
178
+ "blockdevices",
179
+ "boardassettag",
180
+ "boardmanufacturer",
181
+ "boardproductname",
182
+ "boardserialnumber",
183
+ "chassisassettag",
184
+ "chassistype",
185
+ "dhcp_servers",
186
+ "domain",
187
+ "fqdn",
188
+ "gid",
189
+ "hardwareisa",
190
+ "hardwaremodel",
191
+ "hostname",
192
+ "id",
193
+ "interfaces",
194
+ "ipaddress",
195
+ "ipaddress_.*",
196
+ "ipaddress_*",
197
+ "ipaddress6",
198
+ "ipaddress6_.*",
199
+ "ipaddress6_*",
200
+ "ldom_*",
201
+ "lsbdistcodename",
202
+ "lsbdistdescription",
203
+ "lsbdistid",
204
+ "lsbdistrelease",
205
+ "lsbmajdistrelease",
206
+ "lsbminordistrelease",
207
+ "lsbrelease",
208
+ "macaddress",
209
+ "macaddress_.*",
210
+ "macaddress_*",
211
+ "macosx_buildversion",
212
+ "macosx_productname",
213
+ "macosx_productversion",
214
+ "macosx_productversion_major",
215
+ "macosx_productversion_minor",
216
+ "manufacturer",
217
+ "memoryfree",
218
+ "memoryfree_mb",
219
+ "memorysize",
220
+ "memorysize_mb",
221
+ "mtu_.*",
222
+ "mtu_*",
223
+ "netmask",
224
+ "netmask_.*",
225
+ "netmask_*",
226
+ "netmask6",
227
+ "netmask6_.*",
228
+ "netmask6_*",
229
+ "network",
230
+ "network_.*",
231
+ "network_*",
232
+ "network6",
233
+ "network6_.*",
234
+ "network6_*",
235
+ "operatingsystem",
236
+ "operatingsystemmajrelease",
237
+ "operatingsystemrelease",
238
+ "osfamily",
239
+ "physicalprocessorcount",
240
+ "processor.*",
241
+ "processor*",
242
+ "processorcount",
243
+ "productname",
244
+ "rubyplatform",
245
+ "rubysitedir",
246
+ "rubyversion",
247
+ "scope6",
248
+ "scope6_.*",
249
+ "selinux",
250
+ "selinux_config_mode",
251
+ "selinux_config_policy",
252
+ "selinux_current_mode",
253
+ "selinux_enforced",
254
+ "selinux_policyversion",
255
+ "serialnumber",
256
+ "sp_*",
257
+ "sp_boot_mode",
258
+ "sp_boot_rom_version",
259
+ "sp_boot_volume",
260
+ "sp_cpu_type",
261
+ "sp_current_processor_speed",
262
+ "sp_kernel_version",
263
+ "sp_l2_cache_core",
264
+ "sp_l3_cache",
265
+ "sp_local_host_name",
266
+ "sp_machine_model",
267
+ "sp_machine_name",
268
+ "sp_number_processors",
269
+ "sp_os_version",
270
+ "sp_packages",
271
+ "sp_physical_memory",
272
+ "sp_platform_uuid",
273
+ "sp_secure_vm",
274
+ "sp_serial_number",
275
+ "sp_smc_version_system",
276
+ "sp_uptime",
277
+ "sp_user_name",
278
+ "ssh.*key",
279
+ "ssh*key",
280
+ "sshfp_.*",
281
+ "sshfp_*",
282
+ "swapencrypted",
283
+ "swapfree",
284
+ "swapfree_mb",
285
+ "swapsize",
286
+ "swapsize_mb",
287
+ "system32",
288
+ "uptime",
289
+ "uptime_days",
290
+ "uptime_hours",
291
+ "uptime_seconds",
292
+ "uuid",
293
+ "windows_edition_id",
294
+ "windows_installation_type",
295
+ "windows_product_name",
296
+ "windows_release_id",
297
+ "xendomains",
298
+ "zone_*_brand",
299
+ "zone_*_id",
300
+ "zone_*_iptype",
301
+ "zone_*_name",
302
+ "zone_*_path",
303
+ "zone_*_status",
304
+ "zone_*_uuid",
305
+ "zonename",
306
+ "zones"
168
307
  ]
169
- }
308
+ }
@@ -4,13 +4,28 @@ module Facts
4
4
  module Aix
5
5
  class Disks
6
6
  FACT_NAME = 'disks'
7
+ ALIASES = %w[blockdevices blockdevice_.*_size'].freeze
7
8
 
8
9
  def call_the_resolver
10
+ facts = []
9
11
  disks = Facter::Resolvers::Aix::Disks.resolve(:disks)
10
12
 
11
- disks = disks&.empty? ? nil : disks
13
+ return Facter::ResolvedFact.new(FACT_NAME, nil) if disks.nil? || disks.empty?
12
14
 
13
- Facter::ResolvedFact.new(FACT_NAME, disks)
15
+ blockdevices = disks.keys.join(',')
16
+ facts.push(Facter::ResolvedFact.new(FACT_NAME, disks))
17
+ facts.push(Facter::ResolvedFact.new('blockdevices', blockdevices, :legacy))
18
+ add_legacy_facts(disks, facts)
19
+
20
+ facts
21
+ end
22
+
23
+ private
24
+
25
+ def add_legacy_facts(disks, facts)
26
+ disks.each do |disk_name, disk_info|
27
+ facts.push(Facter::ResolvedFact.new("blockdevice_#{disk_name}_size", disk_info[:size_bytes].to_s, :legacy))
28
+ end
14
29
  end
15
30
  end
16
31
  end
@@ -5,11 +5,13 @@ module Facts
5
5
  module Networking
6
6
  class Scope6
7
7
  FACT_NAME = 'networking.scope6'
8
+ ALIASES = 'scope6'
8
9
 
9
10
  def call_the_resolver
10
11
  fact_value = Facter::Resolvers::Aix::Networking.resolve(:scope6)
11
12
 
12
- Facter::ResolvedFact.new(FACT_NAME, fact_value)
13
+ [Facter::ResolvedFact.new(FACT_NAME, fact_value),
14
+ Facter::ResolvedFact.new('scope6', fact_value, :legacy)]
13
15
  end
14
16
  end
15
17
  end
@@ -9,7 +9,6 @@ module Facts
9
9
  def call_the_resolver
10
10
  resolved_facts = []
11
11
  interfaces = Facter::Resolvers::Aix::Networking.resolve(:interfaces)
12
- scope6 = Facter::Resolvers::Aix::Networking.resolve(:scope6)
13
12
 
14
13
  interfaces&.each do |interface_name, info|
15
14
  if info[:scope6]
@@ -17,7 +16,6 @@ module Facts
17
16
  end
18
17
  end
19
18
 
20
- resolved_facts << Facter::ResolvedFact.new('scope6', scope6, :legacy) if scope6
21
19
  resolved_facts
22
20
  end
23
21
  end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Facts
4
+ module Aix
5
+ class Serialnumber
6
+ FACT_NAME = 'serialnumber'
7
+ TYPE = :legacy
8
+
9
+ def call_the_resolver
10
+ Facter::ResolvedFact.new(FACT_NAME, fact_value, :legacy)
11
+ end
12
+
13
+ private
14
+
15
+ def fact_value
16
+ Facter::Resolvers::Aix::Serialnumber.resolve(:serialnumber)
17
+ end
18
+ end
19
+ end
20
+ end
@@ -12,7 +12,7 @@ module Facts
12
12
  private
13
13
 
14
14
  def fact_value
15
- resolver_data.map! { |el| create_ssh_fact(el) }.inject(:merge!)
15
+ resolver_data.map { |el| create_ssh_fact(el) }.inject(:merge)
16
16
  end
17
17
 
18
18
  def resolver_data
@@ -20,6 +20,8 @@ module Facts
20
20
  end
21
21
 
22
22
  def create_ssh_fact(ssh)
23
+ return {} unless ssh
24
+
23
25
  { ssh.name.to_sym => {
24
26
  fingerprints: {
25
27
  sha1: ssh.fingerprint.sha1,
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Facts
4
+ module Aix
5
+ class Sshalgorithmkey
6
+ FACT_NAME = 'ssh.*key'
7
+ TYPE = :legacy
8
+
9
+ def call_the_resolver
10
+ facts = []
11
+ result = Facter::Resolvers::SshResolver.resolve(:ssh)
12
+ result.each { |ssh| facts << Facter::ResolvedFact.new("ssh#{ssh.name.to_sym}key", ssh.key, :legacy) }
13
+ facts
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Facts
4
+ module Aix
5
+ class SshfpAlgorithm
6
+ FACT_NAME = 'sshfp_.*'
7
+ TYPE = :legacy
8
+
9
+ def call_the_resolver
10
+ facts = []
11
+ result = Facter::Resolvers::SshResolver.resolve(:ssh)
12
+ result.each do |ssh|
13
+ facts << Facter::ResolvedFact.new("sshfp_#{ssh.name.to_sym}",
14
+ "#{ssh.fingerprint.sha1}\n#{ssh.fingerprint.sha256}", :legacy)
15
+ end
16
+ facts
17
+ end
18
+ end
19
+ end
20
+ end
@@ -6,7 +6,7 @@ module Facts
6
6
  FACT_NAME = 'load_averages'
7
7
 
8
8
  def call_the_resolver
9
- fact_value = Facter::Resolvers::Bsd::LoadAverages.resolve(:load_averages)
9
+ fact_value = Facter::Resolvers::LoadAverages.resolve(:load_averages)
10
10
  Facter::ResolvedFact.new(FACT_NAME, fact_value)
11
11
  end
12
12
  end
@@ -6,11 +6,16 @@ module Facts
6
6
  module Distro
7
7
  class Release
8
8
  FACT_NAME = 'os.distro.release'
9
+ ALIASES = %w[lsbdistrelease lsbmajdistrelease lsbminordistrelease].freeze
9
10
 
10
11
  def call_the_resolver
11
12
  fact_value = determine_release_for_os
13
+ return Facter::ResolvedFact.new(FACT_NAME, nil) unless fact_value
12
14
 
13
- Facter::ResolvedFact.new(FACT_NAME, fact_value)
15
+ [Facter::ResolvedFact.new(FACT_NAME, fact_value),
16
+ Facter::ResolvedFact.new(ALIASES[0], fact_value['full'], :legacy),
17
+ Facter::ResolvedFact.new(ALIASES[1], fact_value['major'], :legacy),
18
+ Facter::ResolvedFact.new(ALIASES[2], fact_value['minor'], :legacy)]
14
19
  end
15
20
 
16
21
  private
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Facts
4
+ module Freebsd
5
+ module Augeas
6
+ class Version
7
+ FACT_NAME = 'augeas.version'
8
+ ALIASES = 'augeasversion'
9
+
10
+ def call_the_resolver
11
+ fact_value = Facter::Resolvers::Augeas.resolve(:augeas_version)
12
+
13
+ [Facter::ResolvedFact.new(FACT_NAME, fact_value),
14
+ Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Facts
4
+ module Freebsd
5
+ module Dmi
6
+ module Bios
7
+ class ReleaseDate
8
+ FACT_NAME = 'dmi.bios.release_date'
9
+ ALIASES = 'bios_release_date'
10
+
11
+ def call_the_resolver
12
+ fact_value = Facter::Resolvers::Freebsd::DmiBios.resolve(:bios_date)
13
+ [Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Facts
4
+ module Freebsd
5
+ module Dmi
6
+ module Bios
7
+ class Vendor
8
+ FACT_NAME = 'dmi.bios.vendor'
9
+ ALIASES = 'bios_vendor'
10
+
11
+ def call_the_resolver
12
+ fact_value = Facter::Resolvers::Freebsd::DmiBios.resolve(:bios_vendor)
13
+ [Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Facts
4
+ module Freebsd
5
+ module Dmi
6
+ module Bios
7
+ class Version
8
+ FACT_NAME = 'dmi.bios.version'
9
+ ALIASES = 'bios_version'
10
+
11
+ def call_the_resolver
12
+ fact_value = Facter::Resolvers::Freebsd::DmiBios.resolve(:bios_version)
13
+ [Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end