facter 4.0.51 → 4.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +4 -4
  2. data/lib/docs/generate_cli.rb +7 -0
  3. data/lib/facter.rb +71 -58
  4. data/lib/facter/config.rb +2 -0
  5. data/lib/facter/custom_facts/core/aggregate.rb +9 -0
  6. data/lib/facter/custom_facts/core/execution/base.rb +7 -3
  7. data/lib/facter/custom_facts/core/execution/popen3.rb +13 -1
  8. data/lib/facter/custom_facts/core/execution/posix.rb +2 -2
  9. data/lib/facter/custom_facts/core/execution/windows.rb +1 -1
  10. data/lib/facter/custom_facts/core/resolvable.rb +11 -0
  11. data/lib/facter/custom_facts/util/collection.rb +5 -0
  12. data/lib/facter/custom_facts/util/directory_loader.rb +1 -1
  13. data/lib/facter/custom_facts/util/normalization.rb +7 -2
  14. data/lib/facter/custom_facts/util/resolution.rb +2 -0
  15. data/lib/facter/custom_facts/util/windows_root.rb +2 -1
  16. data/lib/facter/facts/aix/processors/cores.rb +16 -0
  17. data/lib/facter/facts/aix/processors/threads.rb +16 -0
  18. data/lib/facter/facts/amzn/lsbdistcodename.rb +16 -0
  19. data/lib/facter/facts/amzn/lsbdistdescription.rb +16 -0
  20. data/lib/facter/facts/amzn/lsbdistid.rb +16 -0
  21. data/lib/facter/facts/amzn/os/distro/codename.rb +24 -0
  22. data/lib/facter/facts/amzn/os/distro/description.rb +21 -0
  23. data/lib/facter/facts/amzn/os/distro/id.rb +21 -0
  24. data/lib/facter/facts/amzn/os/distro/release.rb +32 -0
  25. data/lib/facter/facts/freebsd/is_virtual.rb +1 -5
  26. data/lib/facter/facts/freebsd/virtual.rb +1 -2
  27. data/lib/facter/facts/linux/az_metadata.rb +23 -0
  28. data/lib/facter/facts/linux/cloud/provider.rb +20 -0
  29. data/lib/facter/facts/linux/dhcp_servers.rb +2 -2
  30. data/lib/facter/facts/linux/ec2_metadata.rb +1 -5
  31. data/lib/facter/facts/linux/ec2_userdata.rb +1 -5
  32. data/lib/facter/facts/linux/hypervisors/xen.rb +1 -4
  33. data/lib/facter/facts/linux/interfaces.rb +1 -1
  34. data/lib/facter/facts/linux/ipaddress6_interfaces.rb +1 -1
  35. data/lib/facter/facts/linux/ipaddress_interfaces.rb +1 -1
  36. data/lib/facter/facts/linux/is_virtual.rb +1 -5
  37. data/lib/facter/facts/linux/macaddress_interfaces.rb +1 -1
  38. data/lib/facter/facts/linux/mtu_interfaces.rb +1 -1
  39. data/lib/facter/facts/linux/netmask6_interfaces.rb +1 -1
  40. data/lib/facter/facts/linux/netmask_interfaces.rb +1 -1
  41. data/lib/facter/facts/linux/network6_interfaces.rb +1 -1
  42. data/lib/facter/facts/linux/network_interfaces.rb +1 -1
  43. data/lib/facter/facts/linux/networking/dhcp.rb +1 -1
  44. data/lib/facter/facts/linux/networking/domain.rb +1 -1
  45. data/lib/facter/facts/linux/networking/fqdn.rb +1 -1
  46. data/lib/facter/facts/linux/networking/hostname.rb +1 -1
  47. data/lib/facter/facts/linux/networking/interfaces.rb +1 -1
  48. data/lib/facter/facts/linux/networking/ip.rb +1 -1
  49. data/lib/facter/facts/linux/networking/ip6.rb +1 -1
  50. data/lib/facter/facts/linux/networking/mac.rb +1 -1
  51. data/lib/facter/facts/linux/networking/mtu.rb +1 -1
  52. data/lib/facter/facts/linux/networking/netmask.rb +1 -1
  53. data/lib/facter/facts/linux/networking/netmask6.rb +1 -1
  54. data/lib/facter/facts/linux/networking/network.rb +1 -1
  55. data/lib/facter/facts/linux/networking/network6.rb +1 -1
  56. data/lib/facter/facts/linux/networking/primary.rb +1 -1
  57. data/lib/facter/facts/linux/networking/scope6.rb +1 -1
  58. data/lib/facter/facts/linux/processors/cores.rb +16 -0
  59. data/lib/facter/facts/linux/processors/threads.rb +16 -0
  60. data/lib/facter/facts/linux/scope6_interfaces.rb +1 -1
  61. data/lib/facter/facts/linux/virtual.rb +1 -2
  62. data/lib/facter/facts/macosx/os/macosx/version.rb +15 -4
  63. data/lib/facter/facts/macosx/processors/cores.rb +16 -0
  64. data/lib/facter/facts/macosx/processors/threads.rb +16 -0
  65. data/lib/facter/facts/rhel/lsbdistcodename.rb +16 -0
  66. data/lib/facter/facts/rhel/lsbdistdescription.rb +16 -0
  67. data/lib/facter/facts/rhel/lsbdistid.rb +16 -0
  68. data/lib/facter/facts/rhel/os/distro/codename.rb +2 -4
  69. data/lib/facter/facts/rhel/os/distro/description.rb +2 -4
  70. data/lib/facter/facts/rhel/os/distro/id.rb +2 -4
  71. data/lib/facter/facts/rhel/os/distro/release.rb +13 -12
  72. data/lib/facter/facts/sles/lsbdistcodename.rb +16 -0
  73. data/lib/facter/facts/sles/lsbdistdescription.rb +16 -0
  74. data/lib/facter/facts/sles/lsbdistid.rb +16 -0
  75. data/lib/facter/facts/sles/os/distro/codename.rb +3 -4
  76. data/lib/facter/facts/sles/os/distro/description.rb +2 -5
  77. data/lib/facter/facts/sles/os/distro/id.rb +6 -5
  78. data/lib/facter/facts/sles/os/distro/release.rb +17 -12
  79. data/lib/facter/facts/solaris/hypervisors/ldom.rb +1 -1
  80. data/lib/facter/facts/solaris/hypervisors/zone.rb +1 -1
  81. data/lib/facter/facts/solaris/mountpoints.rb +1 -1
  82. data/lib/facter/facts/solaris/processors/cores.rb +16 -0
  83. data/lib/facter/facts/solaris/processors/threads.rb +16 -0
  84. data/lib/facter/facts/ubuntu/lsbdistrelease.rb +2 -2
  85. data/lib/facter/facts/windows/az_metadata.rb +23 -0
  86. data/lib/facter/facts/windows/cloud/provider.rb +21 -0
  87. data/lib/facter/facts/windows/ec2_metadata.rb +1 -1
  88. data/lib/facter/facts/windows/ec2_userdata.rb +1 -1
  89. data/lib/facter/facts/windows/gce.rb +1 -1
  90. data/lib/facter/facts/windows/hypervisors/hyperv.rb +1 -1
  91. data/lib/facter/facts/windows/hypervisors/kvm.rb +2 -1
  92. data/lib/facter/facts/windows/hypervisors/virtualbox.rb +2 -2
  93. data/lib/facter/facts/windows/hypervisors/vmware.rb +1 -1
  94. data/lib/facter/facts/windows/hypervisors/xen.rb +3 -1
  95. data/lib/facter/facts/windows/is_virtual.rb +15 -0
  96. data/lib/facter/facts/windows/{virtualization/is_virtual.rb → processors/cores.rb} +4 -4
  97. data/lib/facter/facts/windows/{virtualization/virtual.rb → processors/threads.rb} +4 -4
  98. data/lib/facter/facts/windows/virtual.rb +15 -0
  99. data/lib/facter/framework/cli/cli.rb +17 -19
  100. data/lib/facter/framework/config/config_reader.rb +2 -0
  101. data/lib/facter/framework/config/fact_groups.rb +25 -2
  102. data/lib/facter/framework/core/cache_manager.rb +7 -3
  103. data/lib/facter/framework/core/fact/external/external_fact_manager.rb +0 -1
  104. data/lib/facter/framework/core/fact/internal/internal_fact_manager.rb +41 -39
  105. data/lib/facter/framework/core/fact_filter.rb +5 -15
  106. data/lib/facter/framework/core/fact_loaders/external_fact_loader.rb +9 -6
  107. data/lib/facter/framework/core/fact_loaders/fact_loader.rb +39 -37
  108. data/lib/facter/framework/core/fact_manager.rb +84 -14
  109. data/lib/facter/framework/core/file_loader.rb +1 -1
  110. data/lib/facter/framework/core/options.rb +1 -2
  111. data/lib/facter/framework/core/options/config_file_options.rb +7 -0
  112. data/lib/facter/framework/core/options/option_store.rb +4 -4
  113. data/lib/facter/framework/formatters/formatter_helper.rb +3 -5
  114. data/lib/facter/framework/parsers/query_parser.rb +5 -12
  115. data/lib/facter/models/fact_collection.rb +48 -5
  116. data/lib/facter/models/resolved_fact.rb +2 -3
  117. data/lib/facter/models/searched_fact.rb +2 -3
  118. data/lib/facter/resolvers/aix/ffi/ffi_helper.rb +1 -1
  119. data/lib/facter/resolvers/aix/processors.rb +4 -0
  120. data/lib/facter/resolvers/az.rb +39 -0
  121. data/lib/facter/resolvers/base_resolver.rb +2 -2
  122. data/lib/facter/resolvers/dmi_decode.rb +0 -1
  123. data/lib/facter/resolvers/ec2.rb +8 -1
  124. data/lib/facter/resolvers/linux/hostname.rb +126 -0
  125. data/lib/facter/resolvers/linux/networking.rb +124 -0
  126. data/lib/facter/resolvers/macosx/mountpoints.rb +14 -1
  127. data/lib/facter/resolvers/macosx/processor.rb +16 -1
  128. data/lib/facter/resolvers/mountpoints.rb +16 -8
  129. data/lib/facter/resolvers/networking.rb +3 -2
  130. data/lib/facter/resolvers/partitions.rb +1 -1
  131. data/lib/facter/resolvers/processors_lscpu.rb +44 -0
  132. data/lib/facter/resolvers/redhat_release.rb +28 -12
  133. data/lib/facter/resolvers/ruby.rb +1 -1
  134. data/lib/facter/resolvers/selinux.rb +5 -7
  135. data/lib/facter/resolvers/solaris/ffi/functions.rb +1 -1
  136. data/lib/facter/resolvers/solaris/ffi/structs.rb +12 -0
  137. data/lib/facter/resolvers/solaris/mountpoints.rb +22 -16
  138. data/lib/facter/resolvers/solaris/networking.rb +20 -5
  139. data/lib/facter/resolvers/solaris/processors.rb +7 -0
  140. data/lib/facter/resolvers/solaris/zone.rb +0 -1
  141. data/lib/facter/resolvers/windows/ffi/identity_ffi.rb +5 -0
  142. data/lib/facter/resolvers/windows/ffi/kernel_ffi.rb +1 -1
  143. data/lib/facter/resolvers/windows/identity.rb +1 -6
  144. data/lib/facter/resolvers/windows/processors.rb +41 -4
  145. data/lib/facter/resolvers/windows/uptime.rb +3 -22
  146. data/lib/facter/resolvers/windows/virtualization.rb +46 -44
  147. data/lib/facter/resolvers/xen.rb +6 -1
  148. data/lib/facter/templates/man.erb +13 -5
  149. data/lib/facter/util/facts/posix/virtual_detector.rb +74 -0
  150. data/lib/facter/util/facts/unit_converter.rb +2 -2
  151. data/lib/facter/util/linux/dhcp.rb +86 -0
  152. data/lib/facter/util/linux/if_inet6.rb +73 -0
  153. data/lib/facter/util/linux/routing_table.rb +60 -0
  154. data/lib/facter/util/linux/socket_parser.rb +114 -0
  155. data/lib/facter/util/resolvers/ffi/hostname.rb +70 -0
  156. data/lib/facter/util/resolvers/http.rb +7 -1
  157. data/lib/facter/util/resolvers/networking/primary_interface.rb +11 -5
  158. data/lib/facter/util/utils.rb +18 -1
  159. data/lib/facter/version.rb +1 -1
  160. metadata +77 -13
  161. data/lib/facter/facts/linux/cloud.rb +0 -15
  162. data/lib/facter/framework/core/fact_augmenter.rb +0 -37
  163. data/lib/facter/resolvers/cloud.rb +0 -39
  164. data/lib/facter/resolvers/networking_linux.rb +0 -296
  165. data/lib/facter/util/facts/virtual_detector.rb +0 -90
@@ -10,7 +10,7 @@ module Facter
10
10
  CONNECTION_TIMEOUT = 0.6
11
11
  SESSION_TIMEOUT = 5
12
12
 
13
- # Makes a GET http request and returns it's response.
13
+ # Makes a GET http request and returns its response.
14
14
  #
15
15
  # Params:
16
16
  # url: String which contains the address to which the request will be made
@@ -40,6 +40,12 @@ module Facter
40
40
  http = http_obj(uri, timeouts)
41
41
  request = request_obj(headers, uri, request_type)
42
42
 
43
+ # The Windows implementation of sockets does not respect net/http
44
+ # timeouts, so check if the target is reachable in a different way
45
+ if Gem.win_platform?
46
+ Socket.tcp(uri.host, uri.port, connect_timeout: timeouts[:connection] || CONNECTION_TIMEOUT)
47
+ end
48
+
43
49
  # Make the request
44
50
  response = http.request(request)
45
51
  response.uri = url
@@ -37,11 +37,8 @@ module Facter
37
37
  next if index.zero?
38
38
 
39
39
  route = line.strip.split("\t")
40
- if route.count > 7 &&
41
- route[ROUTE_TABLE_MAPPING['Destination']] == '00000000' &&
42
- route[ROUTE_TABLE_MAPPING['Mask']] == '00000000'
43
- return route[ROUTE_TABLE_MAPPING['Iface']]
44
- end
40
+
41
+ return route[ROUTE_TABLE_MAPPING['Iface']] if valid_default_route?(route)
45
42
  end
46
43
 
47
44
  nil
@@ -74,6 +71,15 @@ module Facter
74
71
 
75
72
  nil
76
73
  end
74
+
75
+ private
76
+
77
+ def valid_default_route?(route)
78
+ route.count > 7 &&
79
+ route[ROUTE_TABLE_MAPPING['Destination']] == '00000000' &&
80
+ route[ROUTE_TABLE_MAPPING['Mask']] == '00000000' &&
81
+ route[ROUTE_TABLE_MAPPING['Iface']] != '*' # `*` represents blackhole and not a valid interface
82
+ end
77
83
  end
78
84
  end
79
85
  end
@@ -4,7 +4,7 @@ module Facter
4
4
  module Utils
5
5
  # Sort nested hash.
6
6
  def self.sort_hash_by_key(hash, recursive = true, &block)
7
- hash.keys.sort(&block).each_with_object({}) do |key, seed|
7
+ hash.keys.sort(&block).each_with_object(hash.class.new) do |key, seed|
8
8
  seed[key] = hash[key]
9
9
  seed[key] = sort_hash_by_key(seed[key], true, &block) if recursive && seed[key].is_a?(Hash)
10
10
 
@@ -29,5 +29,22 @@ module Facter
29
29
  object
30
30
  end
31
31
  end
32
+
33
+ def self.try_to_bool(value)
34
+ case value.to_s
35
+ when 'true'
36
+ true
37
+ when 'false'
38
+ false
39
+ else
40
+ value
41
+ end
42
+ end
43
+
44
+ def self.try_to_int(value)
45
+ Integer(value)
46
+ rescue ArgumentError, TypeError
47
+ value
48
+ end
32
49
  end
33
50
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Facter
4
- VERSION = '4.0.51' unless defined?(VERSION)
4
+ VERSION = '4.2.1' unless defined?(VERSION)
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facter
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.51
4
+ version: 4.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-05 00:00:00.000000000 Z
11
+ date: 2021-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -108,6 +108,34 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.3'
111
+ - !ruby/object:Gem::Dependency
112
+ name: timecop
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.9'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0.9'
125
+ - !ruby/object:Gem::Dependency
126
+ name: webmock
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '3.12'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '3.12'
111
139
  - !ruby/object:Gem::Dependency
112
140
  name: yard
113
141
  requirement: !ruby/object:Gem::Requirement
@@ -156,7 +184,7 @@ dependencies:
156
184
  - - "<"
157
185
  - !ruby/object:Gem::Version
158
186
  version: '2.0'
159
- description: New version of Facter
187
+ description: You can prove anything with facts!
160
188
  email:
161
189
  - team-nw@puppet.com
162
190
  executables:
@@ -166,6 +194,7 @@ extra_rdoc_files: []
166
194
  files:
167
195
  - bin/facter
168
196
  - lib/docs/generate.rb
197
+ - lib/docs/generate_cli.rb
169
198
  - lib/docs/template.erb
170
199
  - lib/facter.rb
171
200
  - lib/facter/config.rb
@@ -259,10 +288,12 @@ files:
259
288
  - lib/facter/facts/aix/partitions.rb
260
289
  - lib/facter/facts/aix/path.rb
261
290
  - lib/facter/facts/aix/processor.rb
291
+ - lib/facter/facts/aix/processors/cores.rb
262
292
  - lib/facter/facts/aix/processors/count.rb
263
293
  - lib/facter/facts/aix/processors/isa.rb
264
294
  - lib/facter/facts/aix/processors/models.rb
265
295
  - lib/facter/facts/aix/processors/speed.rb
296
+ - lib/facter/facts/aix/processors/threads.rb
266
297
  - lib/facter/facts/aix/ruby/platform.rb
267
298
  - lib/facter/facts/aix/ruby/sitedir.rb
268
299
  - lib/facter/facts/aix/ruby/version.rb
@@ -277,6 +308,13 @@ files:
277
308
  - lib/facter/facts/aix/system_uptime/uptime.rb
278
309
  - lib/facter/facts/aix/timezone.rb
279
310
  - lib/facter/facts/alpine/os/release.rb
311
+ - lib/facter/facts/amzn/lsbdistcodename.rb
312
+ - lib/facter/facts/amzn/lsbdistdescription.rb
313
+ - lib/facter/facts/amzn/lsbdistid.rb
314
+ - lib/facter/facts/amzn/os/distro/codename.rb
315
+ - lib/facter/facts/amzn/os/distro/description.rb
316
+ - lib/facter/facts/amzn/os/distro/id.rb
317
+ - lib/facter/facts/amzn/os/distro/release.rb
280
318
  - lib/facter/facts/amzn/os/release.rb
281
319
  - lib/facter/facts/bsd/kernelmajversion.rb
282
320
  - lib/facter/facts/bsd/kernelversion.rb
@@ -379,7 +417,8 @@ files:
379
417
  - lib/facter/facts/gentoo/os/release.rb
380
418
  - lib/facter/facts/linux/aio_agent_version.rb
381
419
  - lib/facter/facts/linux/augeas/version.rb
382
- - lib/facter/facts/linux/cloud.rb
420
+ - lib/facter/facts/linux/az_metadata.rb
421
+ - lib/facter/facts/linux/cloud/provider.rb
383
422
  - lib/facter/facts/linux/dhcp_servers.rb
384
423
  - lib/facter/facts/linux/disks.rb
385
424
  - lib/facter/facts/linux/dmi/bios/release_date.rb
@@ -480,11 +519,13 @@ files:
480
519
  - lib/facter/facts/linux/partitions.rb
481
520
  - lib/facter/facts/linux/path.rb
482
521
  - lib/facter/facts/linux/processor.rb
522
+ - lib/facter/facts/linux/processors/cores.rb
483
523
  - lib/facter/facts/linux/processors/count.rb
484
524
  - lib/facter/facts/linux/processors/isa.rb
485
525
  - lib/facter/facts/linux/processors/models.rb
486
526
  - lib/facter/facts/linux/processors/physicalcount.rb
487
527
  - lib/facter/facts/linux/processors/speed.rb
528
+ - lib/facter/facts/linux/processors/threads.rb
488
529
  - lib/facter/facts/linux/ruby/platform.rb
489
530
  - lib/facter/facts/linux/ruby/sitedir.rb
490
531
  - lib/facter/facts/linux/ruby/version.rb
@@ -567,11 +608,13 @@ files:
567
608
  - lib/facter/facts/macosx/os/name.rb
568
609
  - lib/facter/facts/macosx/os/release.rb
569
610
  - lib/facter/facts/macosx/path.rb
611
+ - lib/facter/facts/macosx/processors/cores.rb
570
612
  - lib/facter/facts/macosx/processors/count.rb
571
613
  - lib/facter/facts/macosx/processors/isa.rb
572
614
  - lib/facter/facts/macosx/processors/models.rb
573
615
  - lib/facter/facts/macosx/processors/physicalcount.rb
574
616
  - lib/facter/facts/macosx/processors/speed.rb
617
+ - lib/facter/facts/macosx/processors/threads.rb
575
618
  - lib/facter/facts/macosx/ruby/platform.rb
576
619
  - lib/facter/facts/macosx/ruby/sitedir.rb
577
620
  - lib/facter/facts/macosx/ruby/version.rb
@@ -613,6 +656,9 @@ files:
613
656
  - lib/facter/facts/openwrt/os/release.rb
614
657
  - lib/facter/facts/ovs/os/release.rb
615
658
  - lib/facter/facts/photon/os/release.rb
659
+ - lib/facter/facts/rhel/lsbdistcodename.rb
660
+ - lib/facter/facts/rhel/lsbdistdescription.rb
661
+ - lib/facter/facts/rhel/lsbdistid.rb
616
662
  - lib/facter/facts/rhel/os/distro/codename.rb
617
663
  - lib/facter/facts/rhel/os/distro/description.rb
618
664
  - lib/facter/facts/rhel/os/distro/id.rb
@@ -621,6 +667,9 @@ files:
621
667
  - lib/facter/facts/rhel/os/name.rb
622
668
  - lib/facter/facts/rhel/os/release.rb
623
669
  - lib/facter/facts/slackware/os/release.rb
670
+ - lib/facter/facts/sles/lsbdistcodename.rb
671
+ - lib/facter/facts/sles/lsbdistdescription.rb
672
+ - lib/facter/facts/sles/lsbdistid.rb
624
673
  - lib/facter/facts/sles/os/distro/codename.rb
625
674
  - lib/facter/facts/sles/os/distro/description.rb
626
675
  - lib/facter/facts/sles/os/distro/id.rb
@@ -701,11 +750,13 @@ files:
701
750
  - lib/facter/facts/solaris/os/name.rb
702
751
  - lib/facter/facts/solaris/os/release.rb
703
752
  - lib/facter/facts/solaris/path.rb
753
+ - lib/facter/facts/solaris/processors/cores.rb
704
754
  - lib/facter/facts/solaris/processors/count.rb
705
755
  - lib/facter/facts/solaris/processors/isa.rb
706
756
  - lib/facter/facts/solaris/processors/models.rb
707
757
  - lib/facter/facts/solaris/processors/physicalcount.rb
708
758
  - lib/facter/facts/solaris/processors/speed.rb
759
+ - lib/facter/facts/solaris/processors/threads.rb
709
760
  - lib/facter/facts/solaris/ruby/platform.rb
710
761
  - lib/facter/facts/solaris/ruby/sitedir.rb
711
762
  - lib/facter/facts/solaris/ruby/version.rb
@@ -729,6 +780,8 @@ files:
729
780
  - lib/facter/facts/ubuntu/os/release.rb
730
781
  - lib/facter/facts/windows/aio_agent_version.rb
731
782
  - lib/facter/facts/windows/augeas/version.rb
783
+ - lib/facter/facts/windows/az_metadata.rb
784
+ - lib/facter/facts/windows/cloud/provider.rb
732
785
  - lib/facter/facts/windows/dhcp_servers.rb
733
786
  - lib/facter/facts/windows/dmi/manufacturer.rb
734
787
  - lib/facter/facts/windows/dmi/product/name.rb
@@ -749,6 +802,7 @@ files:
749
802
  - lib/facter/facts/windows/interfaces.rb
750
803
  - lib/facter/facts/windows/ipaddress6_interfaces.rb
751
804
  - lib/facter/facts/windows/ipaddress_interfaces.rb
805
+ - lib/facter/facts/windows/is_virtual.rb
752
806
  - lib/facter/facts/windows/kernel.rb
753
807
  - lib/facter/facts/windows/kernelmajversion.rb
754
808
  - lib/facter/facts/windows/kernelrelease.rb
@@ -793,10 +847,12 @@ files:
793
847
  - lib/facter/facts/windows/os/windows/system32.rb
794
848
  - lib/facter/facts/windows/path.rb
795
849
  - lib/facter/facts/windows/processor.rb
850
+ - lib/facter/facts/windows/processors/cores.rb
796
851
  - lib/facter/facts/windows/processors/count.rb
797
852
  - lib/facter/facts/windows/processors/isa.rb
798
853
  - lib/facter/facts/windows/processors/models.rb
799
854
  - lib/facter/facts/windows/processors/physicalcount.rb
855
+ - lib/facter/facts/windows/processors/threads.rb
800
856
  - lib/facter/facts/windows/ruby/platform.rb
801
857
  - lib/facter/facts/windows/ruby/sitedir.rb
802
858
  - lib/facter/facts/windows/ruby/version.rb
@@ -809,8 +865,7 @@ files:
809
865
  - lib/facter/facts/windows/system_uptime/seconds.rb
810
866
  - lib/facter/facts/windows/system_uptime/uptime.rb
811
867
  - lib/facter/facts/windows/timezone.rb
812
- - lib/facter/facts/windows/virtualization/is_virtual.rb
813
- - lib/facter/facts/windows/virtualization/virtual.rb
868
+ - lib/facter/facts/windows/virtual.rb
814
869
  - lib/facter/framework/benchmarking/timer.rb
815
870
  - lib/facter/framework/cli/cli.rb
816
871
  - lib/facter/framework/cli/cli_launcher.rb
@@ -820,7 +875,6 @@ files:
820
875
  - lib/facter/framework/core/fact/external/external_fact_manager.rb
821
876
  - lib/facter/framework/core/fact/internal/core_fact.rb
822
877
  - lib/facter/framework/core/fact/internal/internal_fact_manager.rb
823
- - lib/facter/framework/core/fact_augmenter.rb
824
878
  - lib/facter/framework/core/fact_filter.rb
825
879
  - lib/facter/framework/core/fact_loaders/class_discoverer.rb
826
880
  - lib/facter/framework/core/fact_loaders/external_fact_loader.rb
@@ -867,10 +921,10 @@ files:
867
921
  - lib/facter/resolvers/aix/processors.rb
868
922
  - lib/facter/resolvers/aix/serialnumber.rb
869
923
  - lib/facter/resolvers/augeas.rb
924
+ - lib/facter/resolvers/az.rb
870
925
  - lib/facter/resolvers/base_resolver.rb
871
926
  - lib/facter/resolvers/bsd/ffi/ffi_helper.rb
872
927
  - lib/facter/resolvers/bsd/processors.rb
873
- - lib/facter/resolvers/cloud.rb
874
928
  - lib/facter/resolvers/containers.rb
875
929
  - lib/facter/resolvers/debian_version.rb
876
930
  - lib/facter/resolvers/disk.rb
@@ -893,7 +947,9 @@ files:
893
947
  - lib/facter/resolvers/hostname.rb
894
948
  - lib/facter/resolvers/identity.rb
895
949
  - lib/facter/resolvers/linux/docker_uptime.rb
950
+ - lib/facter/resolvers/linux/hostname.rb
896
951
  - lib/facter/resolvers/linux/load_averages.rb
952
+ - lib/facter/resolvers/linux/networking.rb
897
953
  - lib/facter/resolvers/load_averages.rb
898
954
  - lib/facter/resolvers/lpar.rb
899
955
  - lib/facter/resolvers/lsb_release.rb
@@ -909,12 +965,12 @@ files:
909
965
  - lib/facter/resolvers/memory.rb
910
966
  - lib/facter/resolvers/mountpoints.rb
911
967
  - lib/facter/resolvers/networking.rb
912
- - lib/facter/resolvers/networking_linux.rb
913
968
  - lib/facter/resolvers/open_vz.rb
914
969
  - lib/facter/resolvers/os_release.rb
915
970
  - lib/facter/resolvers/partitions.rb
916
971
  - lib/facter/resolvers/path.rb
917
972
  - lib/facter/resolvers/processors.rb
973
+ - lib/facter/resolvers/processors_lscpu.rb
918
974
  - lib/facter/resolvers/redhat_release.rb
919
975
  - lib/facter/resolvers/release_from_first_line.rb
920
976
  - lib/facter/resolvers/ruby.rb
@@ -982,13 +1038,18 @@ files:
982
1038
  - lib/facter/util/aix/odm_query.rb
983
1039
  - lib/facter/util/api_debugger.rb
984
1040
  - lib/facter/util/facts/facts_utils.rb
1041
+ - lib/facter/util/facts/posix/virtual_detector.rb
985
1042
  - lib/facter/util/facts/unit_converter.rb
986
1043
  - lib/facter/util/facts/uptime_parser.rb
987
- - lib/facter/util/facts/virtual_detector.rb
988
1044
  - lib/facter/util/facts/windows_release_finder.rb
989
1045
  - lib/facter/util/file_helper.rb
1046
+ - lib/facter/util/linux/dhcp.rb
1047
+ - lib/facter/util/linux/if_inet6.rb
1048
+ - lib/facter/util/linux/routing_table.rb
1049
+ - lib/facter/util/linux/socket_parser.rb
990
1050
  - lib/facter/util/macosx/system_profile_executor.rb
991
1051
  - lib/facter/util/resolvers/aws_token.rb
1052
+ - lib/facter/util/resolvers/ffi/hostname.rb
992
1053
  - lib/facter/util/resolvers/ffi/load_averages.rb
993
1054
  - lib/facter/util/resolvers/filesystem_helper.rb
994
1055
  - lib/facter/util/resolvers/fingerprint.rb
@@ -1002,7 +1063,7 @@ files:
1002
1063
  - lib/facter/util/utils.rb
1003
1064
  - lib/facter/util/windows/win32ole.rb
1004
1065
  - lib/facter/version.rb
1005
- homepage:
1066
+ homepage: https://github.com/puppetlabs/facter
1006
1067
  licenses:
1007
1068
  - MIT
1008
1069
  metadata: {}
@@ -1012,9 +1073,12 @@ require_paths:
1012
1073
  - lib
1013
1074
  required_ruby_version: !ruby/object:Gem::Requirement
1014
1075
  requirements:
1015
- - - "~>"
1076
+ - - ">="
1016
1077
  - !ruby/object:Gem::Version
1017
1078
  version: '2.3'
1079
+ - - "<"
1080
+ - !ruby/object:Gem::Version
1081
+ version: '4.0'
1018
1082
  required_rubygems_version: !ruby/object:Gem::Requirement
1019
1083
  requirements:
1020
1084
  - - ">="
@@ -1024,5 +1088,5 @@ requirements: []
1024
1088
  rubygems_version: 3.0.8
1025
1089
  signing_key:
1026
1090
  specification_version: 4
1027
- summary: New version of Facter
1091
+ summary: Facter, a system inventory tool
1028
1092
  test_files: []
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Facts
4
- module Linux
5
- class Cloud
6
- FACT_NAME = 'cloud'
7
-
8
- def call_the_resolver
9
- cloud_provider = Facter::Resolvers::Cloud.resolve(:cloud_provider)
10
-
11
- Facter::ResolvedFact.new(FACT_NAME, cloud_provider)
12
- end
13
- end
14
- end
15
- end
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Facter
4
- module FactAugmenter
5
- def self.augment_resolved_facts(searched_facts, resolved_facts)
6
- augumented_resolved_facts = []
7
- searched_facts.each do |searched_fact|
8
- matched_facts = get_resolved_facts_for_searched_fact(searched_fact, resolved_facts)
9
- augment_resolved_fact_for_user_query!(searched_fact, matched_facts)
10
- augumented_resolved_facts.concat(matched_facts)
11
- end
12
-
13
- augumented_resolved_facts
14
- end
15
-
16
- private_class_method def self.get_resolved_facts_for_searched_fact(searched_fact, resolved_facts)
17
- if searched_fact.name.include?('.*')
18
- resolved_facts
19
- .select { |resolved_fact| resolved_fact.name.match(searched_fact.name) }
20
- .reject(&:user_query)
21
- .uniq(&:name)
22
- else
23
- resolved_facts
24
- .select { |resolved_fact| searched_fact.name.eql?(resolved_fact.name) }
25
- .reject(&:user_query)
26
- .uniq(&:name)
27
- end
28
- end
29
-
30
- private_class_method def self.augment_resolved_fact_for_user_query!(searched_fact, matched_facts)
31
- matched_facts.each do |matched_fact|
32
- matched_fact.user_query = searched_fact.user_query
33
- matched_fact.filter_tokens = searched_fact.filter_tokens
34
- end
35
- end
36
- end
37
- end
@@ -1,39 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Facter
4
- module Resolvers
5
- class Cloud < BaseResolver
6
- # cloud_provider
7
-
8
- init_resolver
9
-
10
- class << self
11
- private
12
-
13
- def post_resolve(fact_name, _options)
14
- @fact_list.fetch(fact_name) { detect_azure(fact_name) }
15
- end
16
-
17
- def detect_azure(fact_name)
18
- search_dirs = %w[/var/lib/dhcp /var/lib/NetworkManager]
19
- search_dirs.each do |path|
20
- next if !File.readable?(path) || !File.directory?(path)
21
-
22
- files = Dir.entries(path)
23
- files.select! { |filename| filename =~ /^dhclient.*lease.*$/ }
24
- files.each do |file|
25
- path = File.join([path, file])
26
- output = Facter::Util::FileHelper.safe_read(path)
27
-
28
- if output.include?('option unknown-245') || output.include?('option 245')
29
- @fact_list[:cloud_provider] = 'azure'
30
- return @fact_list[fact_name]
31
- end
32
- end
33
- end
34
- nil
35
- end
36
- end
37
- end
38
- end
39
- end