facter 4.0.26 → 4.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/actions/presuite.rb +1 -12
- data/.github/workflows/acceptance_tests.yml +4 -4
- data/.github/workflows/checks.yaml +9 -3
- data/.github/workflows/coverage.yaml +1 -1
- data/.github/workflows/unit_tests.yaml +2 -2
- data/.rubocop.yml +5 -0
- data/.rubocop_todo.yml +6 -4
- data/CHANGELOG.md +22 -0
- data/Rakefile +2 -1
- data/VERSION +1 -1
- data/acceptance/.beaker.yml +15 -0
- data/acceptance/.gitignore +12 -0
- data/acceptance/Gemfile +24 -0
- data/acceptance/Rakefile +2 -0
- data/acceptance/bin/ci-bootstrap-from-artifacts.sh +55 -0
- data/acceptance/config/aio/options.rb +6 -0
- data/acceptance/config/git/options.rb +3 -0
- data/acceptance/config/nodes/aix-53-power.yaml +7 -0
- data/acceptance/config/nodes/aix-61-power.yaml +7 -0
- data/acceptance/config/nodes/aix-71-power.yaml +7 -0
- data/acceptance/config/nodes/huaweios-6-powerpc.yaml +7 -0
- data/acceptance/config/nodes/solaris-10-sparc.yaml +9 -0
- data/acceptance/config/nodes/solaris-11-sparc.yaml +9 -0
- data/acceptance/lib/facter/acceptance/base_fact_utils.rb +565 -0
- data/acceptance/lib/facter/acceptance/user_fact_utils.rb +132 -0
- data/acceptance/lib/helper.rb +3 -0
- data/acceptance/lib/puppet/acceptance/common_utils.rb +10 -0
- data/acceptance/lib/puppet/acceptance/git_utils.rb +19 -0
- data/acceptance/lib/puppet/acceptance/install_utils.rb +58 -0
- data/acceptance/setup/aio/pre-suite/001_run_with_facter_ng.rb +75 -0
- data/acceptance/tests/custom_facts/cached_custom_fact.rb +82 -0
- data/acceptance/tests/custom_facts/conflicts_with_builtin_fact.rb +106 -0
- data/acceptance/tests/custom_facts/custom_fact_with_10001_weight_overrides_external_fact.rb +30 -0
- data/acceptance/tests/custom_facts/expand_command.rb +30 -0
- data/acceptance/tests/custom_facts/having_multiple_facts_in_one_file.rb +40 -0
- data/acceptance/tests/custom_facts/not_expand_command.rb +30 -0
- data/acceptance/tests/custom_facts/using_win32ole_should_not_hang.rb +33 -0
- data/acceptance/tests/custom_facts/weighted_cached_custom_facts.rb +94 -0
- data/acceptance/tests/custom_facts/windows_not_expand_command.rb +30 -0
- data/acceptance/tests/external_facts/env_var_overrides_external_fact.rb +46 -0
- data/acceptance/tests/external_facts/external_dir_overrides_default_external_fact.rb +34 -0
- data/acceptance/tests/external_facts/external_fact_overrides_custom_fact.rb +29 -0
- data/acceptance/tests/external_facts/external_fact_overrides_custom_fact_with_10000_weight_or_less.rb +30 -0
- data/acceptance/tests/external_facts/external_fact_overrides_custom_fact_with_confine.rb +35 -0
- data/acceptance/tests/external_facts/external_fact_stderr_messages_output_to_stderr.rb +49 -0
- data/acceptance/tests/external_facts/external_facts_only_run_once.rb +43 -0
- data/acceptance/tests/external_facts/fact_directory_precedence.rb +109 -0
- data/acceptance/tests/external_facts/handle_same_filename_in_different_dirs.rb +59 -0
- data/acceptance/tests/external_facts/non_root_users_default_external_fact_directory.rb +142 -0
- data/acceptance/tests/external_facts/root_uses_default_external_fact_dir.rb +34 -0
- data/acceptance/tests/external_facts/structured_executable_facts.rb +139 -0
- data/acceptance/tests/facter_returns_success_on_non_existent_fact.rb +9 -0
- data/acceptance/tests/facts/dmi.rb +51 -0
- data/acceptance/tests/facts/facterversion.rb +11 -0
- data/acceptance/tests/facts/identity.rb +52 -0
- data/acceptance/tests/facts/mountpoints_fact.rb +12 -0
- data/acceptance/tests/facts/networking_facts.rb +93 -0
- data/acceptance/tests/facts/nim_type.rb +12 -0
- data/acceptance/tests/facts/non_root_users_without_errors.rb +32 -0
- data/acceptance/tests/facts/operatingsystem_detection_after_clear_on_ubuntu.rb +26 -0
- data/acceptance/tests/facts/os_processors_and_kernel.rb +20 -0
- data/acceptance/tests/facts/osx_numeric_hostname.rb +23 -0
- data/acceptance/tests/facts/partitions.rb +37 -0
- data/acceptance/tests/facts/productname.rb +15 -0
- data/acceptance/tests/facts/ruby.rb +59 -0
- data/acceptance/tests/facts/ssh_key.rb +59 -0
- data/acceptance/tests/facts/validate_file_system_size_bytes.rb +37 -0
- data/acceptance/tests/facts/verify_tmpfs_file_system.rb +54 -0
- data/acceptance/tests/facts/windows_os.rb +64 -0
- data/acceptance/tests/load_libfacter.rb +66 -0
- data/acceptance/tests/no_errors_on_stderr.rb +10 -0
- data/acceptance/tests/options/color.rb +16 -0
- data/acceptance/tests/options/config.rb +27 -0
- data/acceptance/tests/options/config_file/blocklist.rb +35 -0
- data/acceptance/tests/options/config_file/blocklist_from_puppet_facts.rb +40 -0
- data/acceptance/tests/options/config_file/custom_dir_overridden_by_cli_custom_dir.rb +56 -0
- data/acceptance/tests/options/config_file/custom_facts.rb +42 -0
- data/acceptance/tests/options/config_file/custom_facts_list.rb +56 -0
- data/acceptance/tests/options/config_file/debug.rb +34 -0
- data/acceptance/tests/options/config_file/debug_override_config_file.rb +34 -0
- data/acceptance/tests/options/config_file/default_file_location.rb +37 -0
- data/acceptance/tests/options/config_file/external_dir_conflicts_with_cli_no_external_facts.rb +37 -0
- data/acceptance/tests/options/config_file/external_dir_overridden_by_cli_external_dir.rb +40 -0
- data/acceptance/tests/options/config_file/external_facts.rb +37 -0
- data/acceptance/tests/options/config_file/external_facts_list.rb +43 -0
- data/acceptance/tests/options/config_file/load_from_ruby.rb +73 -0
- data/acceptance/tests/options/config_file/log_level.rb +35 -0
- data/acceptance/tests/options/config_file/no_custom_facts_and_custom_dir.rb +43 -0
- data/acceptance/tests/options/config_file/no_custom_facts_and_facterlib.rb +43 -0
- data/acceptance/tests/options/config_file/no_custom_facts_and_load_path.rb +49 -0
- data/acceptance/tests/options/config_file/no_external_facts.rb +38 -0
- data/acceptance/tests/options/config_file/no_external_facts_and_external_dir.rb +34 -0
- data/acceptance/tests/options/config_file/no_ruby_disables_custom_facts.rb +52 -0
- data/acceptance/tests/options/config_file/no_ruby_disables_ruby_facts.rb +34 -0
- data/acceptance/tests/options/config_file/trace.rb +48 -0
- data/acceptance/tests/options/config_file/ttls_cached_external_execution_resolver_with_json_output.rb +92 -0
- data/acceptance/tests/options/config_file/ttls_cached_external_execution_resolver_with_text_output.rb +74 -0
- data/acceptance/tests/options/config_file/ttls_cached_external_execution_resolver_with_yaml_output.rb +88 -0
- data/acceptance/tests/options/config_file/ttls_cached_external_json_resolver.rb +79 -0
- data/acceptance/tests/options/config_file/ttls_cached_external_text_resolver.rb +78 -0
- data/acceptance/tests/options/config_file/ttls_cached_external_yaml_resolver.rb +78 -0
- data/acceptance/tests/options/config_file/ttls_cached_facts_clear_by_empty_ttls_cache_list.rb +71 -0
- data/acceptance/tests/options/config_file/ttls_cached_facts_creates_json_cache_file.rb +48 -0
- data/acceptance/tests/options/config_file/ttls_cached_facts_expire_facts_do_not_read_the_old_cached_value.rb +58 -0
- data/acceptance/tests/options/config_file/ttls_cached_facts_expire_facts_refresh_the_cached_value.rb +61 -0
- data/acceptance/tests/options/config_file/ttls_cached_facts_read_from_the_cached_value.rb +57 -0
- data/acceptance/tests/options/config_file/ttls_cached_facts_that_are_corrupt_are_refreshed.rb +53 -0
- data/acceptance/tests/options/config_file/ttls_cached_facts_that_are_empty_return_an_empty_value.rb +53 -0
- data/acceptance/tests/options/config_file/ttls_puppet_facts_creates_json_for_cached_facts.rb +45 -0
- data/acceptance/tests/options/config_file/ttls_puppet_facts_honors_cached_facts.rb +54 -0
- data/acceptance/tests/options/config_file/verbose.rb +34 -0
- data/acceptance/tests/options/custom_facts.rb +34 -0
- data/acceptance/tests/options/custom_facts_facterlib.rb +33 -0
- data/acceptance/tests/options/custom_facts_list.rb +48 -0
- data/acceptance/tests/options/custom_facts_load_path.rb +42 -0
- data/acceptance/tests/options/debug.rb +12 -0
- data/acceptance/tests/options/external_facts.rb +28 -0
- data/acceptance/tests/options/external_facts_list.rb +35 -0
- data/acceptance/tests/options/help.rb +13 -0
- data/acceptance/tests/options/json.rb +43 -0
- data/acceptance/tests/options/list_block_groups.rb +15 -0
- data/acceptance/tests/options/list_block_groups_facter_4.rb +15 -0
- data/acceptance/tests/options/list_cache_groups.rb +65 -0
- data/acceptance/tests/options/log_level.rb +13 -0
- data/acceptance/tests/options/no_block.rb +34 -0
- data/acceptance/tests/options/no_cache_should_not_cache_facts.rb +43 -0
- data/acceptance/tests/options/no_cache_should_not_load_cached_facts.rb +58 -0
- data/acceptance/tests/options/no_cache_should_not_refresh_cached_facts.rb +63 -0
- data/acceptance/tests/options/no_color.rb +16 -0
- data/acceptance/tests/options/no_custom_facts.rb +34 -0
- data/acceptance/tests/options/no_custom_facts_and_custom_dir.rb +19 -0
- data/acceptance/tests/options/no_custom_facts_and_facterlib.rb +34 -0
- data/acceptance/tests/options/no_custom_facts_and_load_path.rb +43 -0
- data/acceptance/tests/options/no_external_facts.rb +28 -0
- data/acceptance/tests/options/no_external_facts_and_external_dir.rb +19 -0
- data/acceptance/tests/options/no_ruby.rb +44 -0
- data/acceptance/tests/options/puppet_facts.rb +37 -0
- data/acceptance/tests/options/show_legacy.rb +18 -0
- data/acceptance/tests/options/strict.rb +11 -0
- data/acceptance/tests/options/trace.rb +36 -0
- data/acceptance/tests/options/verbose.rb +12 -0
- data/acceptance/tests/options/version.rb +12 -0
- data/acceptance/tests/options/yaml.rb +43 -0
- data/acceptance/tests/ticket_1123_facter_with_invalid_locale.rb +23 -0
- data/acceptance/tests/ticket_1238_hostname_fqdn.rb +57 -0
- data/lib/custom_facts/core/execution/base.rb +18 -18
- data/lib/custom_facts/util/collection.rb +2 -7
- data/lib/custom_facts/util/config.rb +1 -1
- data/lib/custom_facts/util/directory_loader.rb +51 -24
- data/lib/custom_facts/util/fact.rb +10 -1
- data/lib/custom_facts/util/resolution.rb +1 -1
- data/lib/facts/aix/aio_agent_version.rb +14 -0
- data/lib/facts/bsd/processors/count.rb +17 -0
- data/lib/facts/bsd/processors/models.rb +23 -0
- data/lib/facts/bsd/processors/speed.rb +17 -0
- data/lib/facts/freebsd/disks.rb +15 -0
- data/lib/facts/freebsd/partitions.rb +15 -0
- data/lib/facts/freebsd/processors/count.rb +17 -0
- data/lib/facts/freebsd/processors/models.rb +23 -0
- data/lib/facts/freebsd/processors/speed.rb +17 -0
- data/lib/facts/linux/aio_agent_version.rb +14 -0
- data/lib/facts/linux/ec2_metadata.rb +47 -0
- data/lib/facts/linux/ec2_userdata.rb +47 -0
- data/lib/facts/linux/is_virtual.rb +2 -5
- data/lib/facts/linux/virtual.rb +1 -5
- data/lib/facts/macosx/aio_agent_version.rb +14 -0
- data/lib/facts/macosx/interfaces.rb +2 -2
- data/lib/facts/macosx/networking/dhcp.rb +17 -0
- data/lib/facts/macosx/networking/interfaces.rb +21 -0
- data/lib/facts/macosx/networking/ip.rb +4 -1
- data/lib/facts/macosx/networking/ip6.rb +21 -0
- data/lib/facts/macosx/networking/mac.rb +4 -1
- data/lib/facts/macosx/networking/mtu.rb +20 -0
- data/lib/facts/macosx/networking/netmask.rb +21 -0
- data/lib/facts/macosx/networking/netmask6.rb +21 -0
- data/lib/facts/macosx/networking/network.rb +21 -0
- data/lib/facts/macosx/networking/network6.rb +21 -0
- data/lib/facts/macosx/networking/primary.rb +17 -0
- data/lib/facts/macosx/networking/scope6.rb +20 -0
- data/lib/facts/solaris/aio_agent_version.rb +14 -0
- data/lib/facts/windows/aio_agent_version.rb +14 -0
- data/lib/facts/windows/ec2_metadata.rb +23 -0
- data/lib/facts/windows/ec2_userdata.rb +23 -0
- data/lib/facts_utils/hypervisors.rb +10 -0
- data/lib/framework/core/cache_manager.rb +42 -18
- data/lib/framework/core/fact/external/external_fact_manager.rb +3 -2
- data/lib/framework/core/fact_loaders/external_fact_loader.rb +3 -2
- data/lib/framework/formatters/legacy_fact_formatter.rb +6 -5
- data/lib/framework/parsers/query_parser.rb +14 -2
- data/lib/models/loaded_fact.rb +3 -1
- data/lib/models/resolved_fact.rb +1 -1
- data/lib/models/searched_fact.rb +1 -0
- data/lib/resolvers/{agent_resolver.rb → aio_agent_version.rb} +4 -3
- data/lib/resolvers/bsd/ffi/ffi_helper.rb +31 -0
- data/lib/resolvers/bsd/processors.rb +47 -0
- data/lib/resolvers/ec2.rb +77 -0
- data/lib/resolvers/freebsd/ffi/ffi_helper.rb +42 -0
- data/lib/resolvers/freebsd/geom_resolver.rb +109 -0
- data/lib/resolvers/freebsd/processors.rb +44 -0
- data/lib/resolvers/macosx/networking.rb +110 -0
- data/lib/resolvers/networking_linux_resolver.rb +8 -30
- data/lib/resolvers/utils/networking.rb +70 -0
- data/lib/resolvers/windows/aio_agent_version.rb +56 -0
- metadata +175 -5
- data/lib/resolvers/macosx/ipaddress_resolver.rb +0 -52
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Resolvers
|
|
4
|
+
module Utils
|
|
5
|
+
module Networking
|
|
6
|
+
class << self
|
|
7
|
+
# Creates a hash with IP, netmask and network. Works for IPV4 and IPV6
|
|
8
|
+
# @param [String] addr The IP address
|
|
9
|
+
# @param [Integer] mask_length Number of 1 bits the netmask has
|
|
10
|
+
#
|
|
11
|
+
# @return [Hash] Hash containing ip address, netmask and network
|
|
12
|
+
def build_binding(addr, mask_length)
|
|
13
|
+
ip = IPAddr.new(addr)
|
|
14
|
+
mask_helper = ip.ipv6? ? 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff' : '255.255.255.255'
|
|
15
|
+
mask = IPAddr.new(mask_helper).mask(mask_length)
|
|
16
|
+
|
|
17
|
+
{ address: addr, netmask: mask.to_s, network: ip.mask(mask_length).to_s }
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def expand_main_bindings(interfaces)
|
|
21
|
+
interfaces.each_value do |values|
|
|
22
|
+
expand_binding(values, values[:bindings]) if values[:bindings]
|
|
23
|
+
expand_binding(values, values[:bindings6], false) if values[:bindings6]
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def get_scope(ip)
|
|
28
|
+
require 'socket'
|
|
29
|
+
|
|
30
|
+
scope6 = []
|
|
31
|
+
addrinfo = Addrinfo.new(['AF_INET6', 0, nil, ip], :INET6)
|
|
32
|
+
|
|
33
|
+
scope6 << 'compat,' if IPAddr.new(ip).ipv4_compat?
|
|
34
|
+
scope6 << if addrinfo.ipv6_linklocal?
|
|
35
|
+
'link'
|
|
36
|
+
elsif addrinfo.ipv6_sitelocal?
|
|
37
|
+
'site'
|
|
38
|
+
elsif addrinfo.ipv6_loopback?
|
|
39
|
+
'host'
|
|
40
|
+
else 'global'
|
|
41
|
+
end
|
|
42
|
+
scope6.join
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def find_valid_binding(bindings)
|
|
46
|
+
bindings.each do |binding|
|
|
47
|
+
return binding unless ignored_ip_address(binding[:address])
|
|
48
|
+
end
|
|
49
|
+
bindings.empty? ? nil : bindings.first
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def ignored_ip_address(addr)
|
|
53
|
+
addr.empty? || addr.start_with?('127.', '169.254.') || addr.start_with?('fe80') || addr.eql?('::1')
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
private
|
|
57
|
+
|
|
58
|
+
def expand_binding(values, bindings, ipv4_type = true)
|
|
59
|
+
binding = find_valid_binding(bindings)
|
|
60
|
+
ip_protocol_type = ipv4_type ? '' : '6'
|
|
61
|
+
|
|
62
|
+
values["ip#{ip_protocol_type}".to_sym] = binding[:address]
|
|
63
|
+
values["netmask#{ip_protocol_type}".to_sym] = binding[:netmask]
|
|
64
|
+
values["network#{ip_protocol_type}".to_sym] = binding[:network]
|
|
65
|
+
values[:scope6] = get_scope(binding[:address]) unless ipv4_type
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Facter
|
|
4
|
+
module Resolvers
|
|
5
|
+
module Windows
|
|
6
|
+
class AioAgentVersion < BaseResolver
|
|
7
|
+
REGISTRY_PATH = 'SOFTWARE\\Puppet Labs\\Puppet'
|
|
8
|
+
@semaphore = Mutex.new
|
|
9
|
+
@fact_list ||= {}
|
|
10
|
+
|
|
11
|
+
class << self
|
|
12
|
+
private
|
|
13
|
+
|
|
14
|
+
def post_resolve(fact_name)
|
|
15
|
+
@fact_list.fetch(fact_name) { read_version(fact_name) }
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def read_version(fact_name)
|
|
19
|
+
::Win32::Registry::HKEY_LOCAL_MACHINE.open(REGISTRY_PATH) do |reg|
|
|
20
|
+
build_fact_list(reg)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
@fact_list[fact_name]
|
|
24
|
+
rescue Win32::Registry::Error
|
|
25
|
+
log.debug("The registry path #{REGISTRY_PATH} does not exist")
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def build_fact_list(reg)
|
|
29
|
+
puppet_aio_path = read_for_64_bit(reg) || read_for_32_bit(reg)
|
|
30
|
+
|
|
31
|
+
return if puppet_aio_path.nil? || puppet_aio_path.empty?
|
|
32
|
+
|
|
33
|
+
puppet_aio_version_path = File.join(puppet_aio_path, 'VERSION')
|
|
34
|
+
aio_agent_version = Util::FileHelper.safe_read(puppet_aio_version_path, nil)&.chomp
|
|
35
|
+
|
|
36
|
+
@fact_list[:aio_agent_version] = aio_agent_version&.match(/^\d+\.\d+\.\d+(\.\d+){0,2}/)&.to_s
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def read_for_64_bit(reg)
|
|
40
|
+
reg.read('RememberedInstallDir64')[1]
|
|
41
|
+
rescue Win32::Registry::Error
|
|
42
|
+
log.debug('Could not read Puppet AIO path from 64 bit registry')
|
|
43
|
+
nil
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def read_for_32_bit(reg)
|
|
47
|
+
reg.read('RememberedInstallDir')[1]
|
|
48
|
+
rescue Win32::Registry::Error
|
|
49
|
+
log.debug('Could not read Puppet AIO path from 32 bit registry')
|
|
50
|
+
nil
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
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.
|
|
4
|
+
version: 4.0.28
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Puppet
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-06-
|
|
11
|
+
date: 2020-06-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -198,6 +198,141 @@ files:
|
|
|
198
198
|
- README.md
|
|
199
199
|
- Rakefile
|
|
200
200
|
- VERSION
|
|
201
|
+
- acceptance/.beaker.yml
|
|
202
|
+
- acceptance/.gitignore
|
|
203
|
+
- acceptance/Gemfile
|
|
204
|
+
- acceptance/Rakefile
|
|
205
|
+
- acceptance/bin/ci-bootstrap-from-artifacts.sh
|
|
206
|
+
- acceptance/config/aio/options.rb
|
|
207
|
+
- acceptance/config/git/options.rb
|
|
208
|
+
- acceptance/config/nodes/aix-53-power.yaml
|
|
209
|
+
- acceptance/config/nodes/aix-61-power.yaml
|
|
210
|
+
- acceptance/config/nodes/aix-71-power.yaml
|
|
211
|
+
- acceptance/config/nodes/huaweios-6-powerpc.yaml
|
|
212
|
+
- acceptance/config/nodes/solaris-10-sparc.yaml
|
|
213
|
+
- acceptance/config/nodes/solaris-11-sparc.yaml
|
|
214
|
+
- acceptance/lib/facter/acceptance/base_fact_utils.rb
|
|
215
|
+
- acceptance/lib/facter/acceptance/user_fact_utils.rb
|
|
216
|
+
- acceptance/lib/helper.rb
|
|
217
|
+
- acceptance/lib/puppet/acceptance/common_utils.rb
|
|
218
|
+
- acceptance/lib/puppet/acceptance/git_utils.rb
|
|
219
|
+
- acceptance/lib/puppet/acceptance/install_utils.rb
|
|
220
|
+
- acceptance/setup/aio/pre-suite/001_run_with_facter_ng.rb
|
|
221
|
+
- acceptance/tests/custom_facts/cached_custom_fact.rb
|
|
222
|
+
- acceptance/tests/custom_facts/conflicts_with_builtin_fact.rb
|
|
223
|
+
- acceptance/tests/custom_facts/custom_fact_with_10001_weight_overrides_external_fact.rb
|
|
224
|
+
- acceptance/tests/custom_facts/expand_command.rb
|
|
225
|
+
- acceptance/tests/custom_facts/having_multiple_facts_in_one_file.rb
|
|
226
|
+
- acceptance/tests/custom_facts/not_expand_command.rb
|
|
227
|
+
- acceptance/tests/custom_facts/using_win32ole_should_not_hang.rb
|
|
228
|
+
- acceptance/tests/custom_facts/weighted_cached_custom_facts.rb
|
|
229
|
+
- acceptance/tests/custom_facts/windows_not_expand_command.rb
|
|
230
|
+
- acceptance/tests/external_facts/env_var_overrides_external_fact.rb
|
|
231
|
+
- acceptance/tests/external_facts/external_dir_overrides_default_external_fact.rb
|
|
232
|
+
- acceptance/tests/external_facts/external_fact_overrides_custom_fact.rb
|
|
233
|
+
- acceptance/tests/external_facts/external_fact_overrides_custom_fact_with_10000_weight_or_less.rb
|
|
234
|
+
- acceptance/tests/external_facts/external_fact_overrides_custom_fact_with_confine.rb
|
|
235
|
+
- acceptance/tests/external_facts/external_fact_stderr_messages_output_to_stderr.rb
|
|
236
|
+
- acceptance/tests/external_facts/external_facts_only_run_once.rb
|
|
237
|
+
- acceptance/tests/external_facts/fact_directory_precedence.rb
|
|
238
|
+
- acceptance/tests/external_facts/handle_same_filename_in_different_dirs.rb
|
|
239
|
+
- acceptance/tests/external_facts/non_root_users_default_external_fact_directory.rb
|
|
240
|
+
- acceptance/tests/external_facts/root_uses_default_external_fact_dir.rb
|
|
241
|
+
- acceptance/tests/external_facts/structured_executable_facts.rb
|
|
242
|
+
- acceptance/tests/facter_returns_success_on_non_existent_fact.rb
|
|
243
|
+
- acceptance/tests/facts/dmi.rb
|
|
244
|
+
- acceptance/tests/facts/facterversion.rb
|
|
245
|
+
- acceptance/tests/facts/identity.rb
|
|
246
|
+
- acceptance/tests/facts/mountpoints_fact.rb
|
|
247
|
+
- acceptance/tests/facts/networking_facts.rb
|
|
248
|
+
- acceptance/tests/facts/nim_type.rb
|
|
249
|
+
- acceptance/tests/facts/non_root_users_without_errors.rb
|
|
250
|
+
- acceptance/tests/facts/operatingsystem_detection_after_clear_on_ubuntu.rb
|
|
251
|
+
- acceptance/tests/facts/os_processors_and_kernel.rb
|
|
252
|
+
- acceptance/tests/facts/osx_numeric_hostname.rb
|
|
253
|
+
- acceptance/tests/facts/partitions.rb
|
|
254
|
+
- acceptance/tests/facts/productname.rb
|
|
255
|
+
- acceptance/tests/facts/ruby.rb
|
|
256
|
+
- acceptance/tests/facts/ssh_key.rb
|
|
257
|
+
- acceptance/tests/facts/validate_file_system_size_bytes.rb
|
|
258
|
+
- acceptance/tests/facts/verify_tmpfs_file_system.rb
|
|
259
|
+
- acceptance/tests/facts/windows_os.rb
|
|
260
|
+
- acceptance/tests/load_libfacter.rb
|
|
261
|
+
- acceptance/tests/no_errors_on_stderr.rb
|
|
262
|
+
- acceptance/tests/options/color.rb
|
|
263
|
+
- acceptance/tests/options/config.rb
|
|
264
|
+
- acceptance/tests/options/config_file/blocklist.rb
|
|
265
|
+
- acceptance/tests/options/config_file/blocklist_from_puppet_facts.rb
|
|
266
|
+
- acceptance/tests/options/config_file/custom_dir_overridden_by_cli_custom_dir.rb
|
|
267
|
+
- acceptance/tests/options/config_file/custom_facts.rb
|
|
268
|
+
- acceptance/tests/options/config_file/custom_facts_list.rb
|
|
269
|
+
- acceptance/tests/options/config_file/debug.rb
|
|
270
|
+
- acceptance/tests/options/config_file/debug_override_config_file.rb
|
|
271
|
+
- acceptance/tests/options/config_file/default_file_location.rb
|
|
272
|
+
- acceptance/tests/options/config_file/external_dir_conflicts_with_cli_no_external_facts.rb
|
|
273
|
+
- acceptance/tests/options/config_file/external_dir_overridden_by_cli_external_dir.rb
|
|
274
|
+
- acceptance/tests/options/config_file/external_facts.rb
|
|
275
|
+
- acceptance/tests/options/config_file/external_facts_list.rb
|
|
276
|
+
- acceptance/tests/options/config_file/load_from_ruby.rb
|
|
277
|
+
- acceptance/tests/options/config_file/log_level.rb
|
|
278
|
+
- acceptance/tests/options/config_file/no_custom_facts_and_custom_dir.rb
|
|
279
|
+
- acceptance/tests/options/config_file/no_custom_facts_and_facterlib.rb
|
|
280
|
+
- acceptance/tests/options/config_file/no_custom_facts_and_load_path.rb
|
|
281
|
+
- acceptance/tests/options/config_file/no_external_facts.rb
|
|
282
|
+
- acceptance/tests/options/config_file/no_external_facts_and_external_dir.rb
|
|
283
|
+
- acceptance/tests/options/config_file/no_ruby_disables_custom_facts.rb
|
|
284
|
+
- acceptance/tests/options/config_file/no_ruby_disables_ruby_facts.rb
|
|
285
|
+
- acceptance/tests/options/config_file/trace.rb
|
|
286
|
+
- acceptance/tests/options/config_file/ttls_cached_external_execution_resolver_with_json_output.rb
|
|
287
|
+
- acceptance/tests/options/config_file/ttls_cached_external_execution_resolver_with_text_output.rb
|
|
288
|
+
- acceptance/tests/options/config_file/ttls_cached_external_execution_resolver_with_yaml_output.rb
|
|
289
|
+
- acceptance/tests/options/config_file/ttls_cached_external_json_resolver.rb
|
|
290
|
+
- acceptance/tests/options/config_file/ttls_cached_external_text_resolver.rb
|
|
291
|
+
- acceptance/tests/options/config_file/ttls_cached_external_yaml_resolver.rb
|
|
292
|
+
- acceptance/tests/options/config_file/ttls_cached_facts_clear_by_empty_ttls_cache_list.rb
|
|
293
|
+
- acceptance/tests/options/config_file/ttls_cached_facts_creates_json_cache_file.rb
|
|
294
|
+
- acceptance/tests/options/config_file/ttls_cached_facts_expire_facts_do_not_read_the_old_cached_value.rb
|
|
295
|
+
- acceptance/tests/options/config_file/ttls_cached_facts_expire_facts_refresh_the_cached_value.rb
|
|
296
|
+
- acceptance/tests/options/config_file/ttls_cached_facts_read_from_the_cached_value.rb
|
|
297
|
+
- acceptance/tests/options/config_file/ttls_cached_facts_that_are_corrupt_are_refreshed.rb
|
|
298
|
+
- acceptance/tests/options/config_file/ttls_cached_facts_that_are_empty_return_an_empty_value.rb
|
|
299
|
+
- acceptance/tests/options/config_file/ttls_puppet_facts_creates_json_for_cached_facts.rb
|
|
300
|
+
- acceptance/tests/options/config_file/ttls_puppet_facts_honors_cached_facts.rb
|
|
301
|
+
- acceptance/tests/options/config_file/verbose.rb
|
|
302
|
+
- acceptance/tests/options/custom_facts.rb
|
|
303
|
+
- acceptance/tests/options/custom_facts_facterlib.rb
|
|
304
|
+
- acceptance/tests/options/custom_facts_list.rb
|
|
305
|
+
- acceptance/tests/options/custom_facts_load_path.rb
|
|
306
|
+
- acceptance/tests/options/debug.rb
|
|
307
|
+
- acceptance/tests/options/external_facts.rb
|
|
308
|
+
- acceptance/tests/options/external_facts_list.rb
|
|
309
|
+
- acceptance/tests/options/help.rb
|
|
310
|
+
- acceptance/tests/options/json.rb
|
|
311
|
+
- acceptance/tests/options/list_block_groups.rb
|
|
312
|
+
- acceptance/tests/options/list_block_groups_facter_4.rb
|
|
313
|
+
- acceptance/tests/options/list_cache_groups.rb
|
|
314
|
+
- acceptance/tests/options/log_level.rb
|
|
315
|
+
- acceptance/tests/options/no_block.rb
|
|
316
|
+
- acceptance/tests/options/no_cache_should_not_cache_facts.rb
|
|
317
|
+
- acceptance/tests/options/no_cache_should_not_load_cached_facts.rb
|
|
318
|
+
- acceptance/tests/options/no_cache_should_not_refresh_cached_facts.rb
|
|
319
|
+
- acceptance/tests/options/no_color.rb
|
|
320
|
+
- acceptance/tests/options/no_custom_facts.rb
|
|
321
|
+
- acceptance/tests/options/no_custom_facts_and_custom_dir.rb
|
|
322
|
+
- acceptance/tests/options/no_custom_facts_and_facterlib.rb
|
|
323
|
+
- acceptance/tests/options/no_custom_facts_and_load_path.rb
|
|
324
|
+
- acceptance/tests/options/no_external_facts.rb
|
|
325
|
+
- acceptance/tests/options/no_external_facts_and_external_dir.rb
|
|
326
|
+
- acceptance/tests/options/no_ruby.rb
|
|
327
|
+
- acceptance/tests/options/puppet_facts.rb
|
|
328
|
+
- acceptance/tests/options/show_legacy.rb
|
|
329
|
+
- acceptance/tests/options/strict.rb
|
|
330
|
+
- acceptance/tests/options/trace.rb
|
|
331
|
+
- acceptance/tests/options/verbose.rb
|
|
332
|
+
- acceptance/tests/options/version.rb
|
|
333
|
+
- acceptance/tests/options/yaml.rb
|
|
334
|
+
- acceptance/tests/ticket_1123_facter_with_invalid_locale.rb
|
|
335
|
+
- acceptance/tests/ticket_1238_hostname_fqdn.rb
|
|
201
336
|
- agent/facter-ng.gemspec
|
|
202
337
|
- agent/lib/facter-ng.rb
|
|
203
338
|
- bin/facter
|
|
@@ -237,6 +372,7 @@ files:
|
|
|
237
372
|
- lib/custom_facts/util/windows_root.rb
|
|
238
373
|
- lib/custom_facts/version.rb
|
|
239
374
|
- lib/facter.rb
|
|
375
|
+
- lib/facts/aix/aio_agent_version.rb
|
|
240
376
|
- lib/facts/aix/augeas/version.rb
|
|
241
377
|
- lib/facts/aix/facterversion.rb
|
|
242
378
|
- lib/facts/aix/filesystems.rb
|
|
@@ -285,6 +421,9 @@ files:
|
|
|
285
421
|
- lib/facts/bsd/kernelversion.rb
|
|
286
422
|
- lib/facts/bsd/load_averages.rb
|
|
287
423
|
- lib/facts/bsd/os/family.rb
|
|
424
|
+
- lib/facts/bsd/processors/count.rb
|
|
425
|
+
- lib/facts/bsd/processors/models.rb
|
|
426
|
+
- lib/facts/bsd/processors/speed.rb
|
|
288
427
|
- lib/facts/debian/architecture.rb
|
|
289
428
|
- lib/facts/debian/lsbdistcodename.rb
|
|
290
429
|
- lib/facts/debian/lsbdistdescription.rb
|
|
@@ -294,7 +433,13 @@ files:
|
|
|
294
433
|
- lib/facts/debian/os/distro/id.rb
|
|
295
434
|
- lib/facts/debian/os/distro/release.rb
|
|
296
435
|
- lib/facts/debian/os/release.rb
|
|
436
|
+
- lib/facts/freebsd/disks.rb
|
|
297
437
|
- lib/facts/freebsd/os/release.rb
|
|
438
|
+
- lib/facts/freebsd/partitions.rb
|
|
439
|
+
- lib/facts/freebsd/processors/count.rb
|
|
440
|
+
- lib/facts/freebsd/processors/models.rb
|
|
441
|
+
- lib/facts/freebsd/processors/speed.rb
|
|
442
|
+
- lib/facts/linux/aio_agent_version.rb
|
|
298
443
|
- lib/facts/linux/augeas/version.rb
|
|
299
444
|
- lib/facts/linux/dhcp_servers.rb
|
|
300
445
|
- lib/facts/linux/disks.rb
|
|
@@ -310,6 +455,8 @@ files:
|
|
|
310
455
|
- lib/facts/linux/dmi/product/name.rb
|
|
311
456
|
- lib/facts/linux/dmi/product/serial_number.rb
|
|
312
457
|
- lib/facts/linux/dmi/product/uuid.rb
|
|
458
|
+
- lib/facts/linux/ec2_metadata.rb
|
|
459
|
+
- lib/facts/linux/ec2_userdata.rb
|
|
313
460
|
- lib/facts/linux/facterversion.rb
|
|
314
461
|
- lib/facts/linux/filesystems.rb
|
|
315
462
|
- lib/facts/linux/fips_enabled.rb
|
|
@@ -402,6 +549,7 @@ files:
|
|
|
402
549
|
- lib/facts/linux/system_uptime/uptime.rb
|
|
403
550
|
- lib/facts/linux/timezone.rb
|
|
404
551
|
- lib/facts/linux/virtual.rb
|
|
552
|
+
- lib/facts/macosx/aio_agent_version.rb
|
|
405
553
|
- lib/facts/macosx/augeas/version.rb
|
|
406
554
|
- lib/facts/macosx/dmi/product/name.rb
|
|
407
555
|
- lib/facts/macosx/facterversion.rb
|
|
@@ -434,11 +582,21 @@ files:
|
|
|
434
582
|
- lib/facts/macosx/memory/system/used.rb
|
|
435
583
|
- lib/facts/macosx/memory/system/used_bytes.rb
|
|
436
584
|
- lib/facts/macosx/mountpoints.rb
|
|
585
|
+
- lib/facts/macosx/networking/dhcp.rb
|
|
437
586
|
- lib/facts/macosx/networking/domain.rb
|
|
438
587
|
- lib/facts/macosx/networking/fqdn.rb
|
|
439
588
|
- lib/facts/macosx/networking/hostname.rb
|
|
589
|
+
- lib/facts/macosx/networking/interfaces.rb
|
|
440
590
|
- lib/facts/macosx/networking/ip.rb
|
|
591
|
+
- lib/facts/macosx/networking/ip6.rb
|
|
441
592
|
- lib/facts/macosx/networking/mac.rb
|
|
593
|
+
- lib/facts/macosx/networking/mtu.rb
|
|
594
|
+
- lib/facts/macosx/networking/netmask.rb
|
|
595
|
+
- lib/facts/macosx/networking/netmask6.rb
|
|
596
|
+
- lib/facts/macosx/networking/network.rb
|
|
597
|
+
- lib/facts/macosx/networking/network6.rb
|
|
598
|
+
- lib/facts/macosx/networking/primary.rb
|
|
599
|
+
- lib/facts/macosx/networking/scope6.rb
|
|
442
600
|
- lib/facts/macosx/os/architecture.rb
|
|
443
601
|
- lib/facts/macosx/os/family.rb
|
|
444
602
|
- lib/facts/macosx/os/hardware.rb
|
|
@@ -499,6 +657,7 @@ files:
|
|
|
499
657
|
- lib/facts/sles/os/distro/release.rb
|
|
500
658
|
- lib/facts/sles/os/family.rb
|
|
501
659
|
- lib/facts/sles/os/release.rb
|
|
660
|
+
- lib/facts/solaris/aio_agent_version.rb
|
|
502
661
|
- lib/facts/solaris/augeas/version.rb
|
|
503
662
|
- lib/facts/solaris/facterversion.rb
|
|
504
663
|
- lib/facts/solaris/filesystems.rb
|
|
@@ -546,12 +705,15 @@ files:
|
|
|
546
705
|
- lib/facts/solaris/zpool_version.rb
|
|
547
706
|
- lib/facts/ubuntu/os/distro/release.rb
|
|
548
707
|
- lib/facts/ubuntu/os/release.rb
|
|
708
|
+
- lib/facts/windows/aio_agent_version.rb
|
|
549
709
|
- lib/facts/windows/augeas/version.rb
|
|
550
710
|
- lib/facts/windows/dhcp_servers.rb
|
|
551
711
|
- lib/facts/windows/dmi/manufacturer.rb
|
|
552
712
|
- lib/facts/windows/dmi/product/name.rb
|
|
553
713
|
- lib/facts/windows/dmi/product/serial_number.rb
|
|
554
714
|
- lib/facts/windows/dmi/product/uuid.rb
|
|
715
|
+
- lib/facts/windows/ec2_metadata.rb
|
|
716
|
+
- lib/facts/windows/ec2_userdata.rb
|
|
555
717
|
- lib/facts/windows/facterversion.rb
|
|
556
718
|
- lib/facts/windows/fips_enabled.rb
|
|
557
719
|
- lib/facts/windows/hypervisors/hyperv.rb
|
|
@@ -625,6 +787,7 @@ files:
|
|
|
625
787
|
- lib/facts/windows/timezone.rb
|
|
626
788
|
- lib/facts/windows/virtualization/is_virtual.rb
|
|
627
789
|
- lib/facts/windows/virtualization/virtual.rb
|
|
790
|
+
- lib/facts_utils/hypervisors.rb
|
|
628
791
|
- lib/facts_utils/unit_converter.rb
|
|
629
792
|
- lib/facts_utils/uptime_parser.rb
|
|
630
793
|
- lib/facts_utils/windows_release_finder.rb
|
|
@@ -665,7 +828,7 @@ files:
|
|
|
665
828
|
- lib/models/loaded_fact.rb
|
|
666
829
|
- lib/models/resolved_fact.rb
|
|
667
830
|
- lib/models/searched_fact.rb
|
|
668
|
-
- lib/resolvers/
|
|
831
|
+
- lib/resolvers/aio_agent_version.rb
|
|
669
832
|
- lib/resolvers/aix/architecture_resolver.rb
|
|
670
833
|
- lib/resolvers/aix/ffi/ffi_helper.rb
|
|
671
834
|
- lib/resolvers/aix/filesystem_resolver.rb
|
|
@@ -682,15 +845,20 @@ files:
|
|
|
682
845
|
- lib/resolvers/base_resolver.rb
|
|
683
846
|
- lib/resolvers/bsd/ffi/ffi_helper.rb
|
|
684
847
|
- lib/resolvers/bsd/load_averages_resolver.rb
|
|
848
|
+
- lib/resolvers/bsd/processors.rb
|
|
685
849
|
- lib/resolvers/debian_version.rb
|
|
686
850
|
- lib/resolvers/disk_resolver.rb
|
|
687
851
|
- lib/resolvers/dmi_resolver.rb
|
|
688
852
|
- lib/resolvers/docker_lxc.rb
|
|
853
|
+
- lib/resolvers/ec2.rb
|
|
689
854
|
- lib/resolvers/eos_release_resolver.rb
|
|
690
855
|
- lib/resolvers/facterversion_resolver.rb
|
|
691
856
|
- lib/resolvers/filesystems_resolver.rb
|
|
692
857
|
- lib/resolvers/fips_enabled_resolver.rb
|
|
858
|
+
- lib/resolvers/freebsd/ffi/ffi_helper.rb
|
|
693
859
|
- lib/resolvers/freebsd/freebsd_version_resolver.rb
|
|
860
|
+
- lib/resolvers/freebsd/geom_resolver.rb
|
|
861
|
+
- lib/resolvers/freebsd/processors.rb
|
|
694
862
|
- lib/resolvers/hostname_resolver.rb
|
|
695
863
|
- lib/resolvers/identity_resolver.rb
|
|
696
864
|
- lib/resolvers/load_averages_resolver.rb
|
|
@@ -699,9 +867,9 @@ files:
|
|
|
699
867
|
- lib/resolvers/lspci.rb
|
|
700
868
|
- lib/resolvers/macosx/dmi_resolver.rb
|
|
701
869
|
- lib/resolvers/macosx/filesystems_resolver.rb
|
|
702
|
-
- lib/resolvers/macosx/ipaddress_resolver.rb
|
|
703
870
|
- lib/resolvers/macosx/load_averages_resolver.rb
|
|
704
871
|
- lib/resolvers/macosx/mountpoints_resolver.rb
|
|
872
|
+
- lib/resolvers/macosx/networking.rb
|
|
705
873
|
- lib/resolvers/macosx/processor_resolver.rb
|
|
706
874
|
- lib/resolvers/macosx/swap_memory_resolver.rb
|
|
707
875
|
- lib/resolvers/macosx/system_memory_resolver.rb
|
|
@@ -735,10 +903,12 @@ files:
|
|
|
735
903
|
- lib/resolvers/uptime_resolver.rb
|
|
736
904
|
- lib/resolvers/utils/filesystem_helper.rb
|
|
737
905
|
- lib/resolvers/utils/fingerprint.rb
|
|
906
|
+
- lib/resolvers/utils/networking.rb
|
|
738
907
|
- lib/resolvers/utils/ssh.rb
|
|
739
908
|
- lib/resolvers/utils/ssh_helper.rb
|
|
740
909
|
- lib/resolvers/virt_what.rb
|
|
741
910
|
- lib/resolvers/vmware.rb
|
|
911
|
+
- lib/resolvers/windows/aio_agent_version.rb
|
|
742
912
|
- lib/resolvers/windows/dmi_bios_resolver.rb
|
|
743
913
|
- lib/resolvers/windows/dmi_computersystem_resolver.rb
|
|
744
914
|
- lib/resolvers/windows/ffi/ffi.rb
|
|
@@ -799,7 +969,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
799
969
|
- !ruby/object:Gem::Version
|
|
800
970
|
version: '0'
|
|
801
971
|
requirements: []
|
|
802
|
-
rubygems_version: 3.0.
|
|
972
|
+
rubygems_version: 3.0.8
|
|
803
973
|
signing_key:
|
|
804
974
|
specification_version: 4
|
|
805
975
|
summary: New version of Facter
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Facter
|
|
4
|
-
module Resolvers
|
|
5
|
-
module Macosx
|
|
6
|
-
class Ipaddress < BaseResolver
|
|
7
|
-
@semaphore = Mutex.new
|
|
8
|
-
@fact_list ||= {}
|
|
9
|
-
class << self
|
|
10
|
-
private
|
|
11
|
-
|
|
12
|
-
def post_resolve(fact_name)
|
|
13
|
-
@fact_list.fetch(fact_name) { read_ipaddress(fact_name) }
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def read_ipaddress(fact_name)
|
|
17
|
-
ip = nil
|
|
18
|
-
primary_interface = read_primary_interface
|
|
19
|
-
unless primary_interface.nil?
|
|
20
|
-
@fact_list[:primary] = primary_interface
|
|
21
|
-
output = Facter::Core::Execution.execute("ipconfig getifaddr #{primary_interface}", logger: log)
|
|
22
|
-
ip = output.strip
|
|
23
|
-
end
|
|
24
|
-
find_all_interfaces
|
|
25
|
-
@fact_list[:ip] = ip
|
|
26
|
-
@fact_list[fact_name]
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def read_primary_interface
|
|
30
|
-
iface = nil
|
|
31
|
-
output = Facter::Core::Execution.execute('route -n get default', logger: log)
|
|
32
|
-
output.split(/^\S/).each do |str|
|
|
33
|
-
iface = Regexp.last_match(1) if str.strip =~ /interface: (\S+)/
|
|
34
|
-
end
|
|
35
|
-
iface
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def find_all_interfaces
|
|
39
|
-
output = Facter::Core::Execution.execute('ifconfig -a', logger: log)
|
|
40
|
-
|
|
41
|
-
data_hash = Hash[*output.split(/^([A-Za-z0-9_]+): /)[1..-1]]
|
|
42
|
-
|
|
43
|
-
macaddress = */ether (([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2}))/.match(data_hash[@fact_list[:primary]])
|
|
44
|
-
@fact_list[:macaddress] = macaddress[1]
|
|
45
|
-
|
|
46
|
-
@fact_list[:interfaces] = data_hash.keys.join(',')
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
end
|