facter 4.0.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +13 -0
- data/.github/actions/presuite.rb +109 -0
- data/.github/workflows/acceptance_tests.yml +67 -0
- data/.github/workflows/checks.yaml +71 -0
- data/.github/workflows/unit_tests.yaml +41 -0
- data/.gitignore +57 -0
- data/.jrubyrc +2 -0
- data/.rspec +2 -0
- data/.rubocop.yml +165 -0
- data/.rubocop_todo.yml +236 -0
- data/.rubycritic.yml +4 -0
- data/CHANGELOG.md +175 -0
- data/CODEOWNERS +2 -0
- data/CONTRIBUTING.md +93 -0
- data/Gemfile +12 -0
- data/LICENSE +21 -0
- data/README.md +50 -0
- data/Rakefile +71 -0
- data/VERSION +1 -0
- data/agent/facter-ng.gemspec +48 -0
- data/agent/lib/facter-ng.rb +7 -0
- data/bin/facter +6 -0
- data/check.sh +12 -0
- data/config/config.rb +6 -0
- data/custom_facts/my_custom_fact.rb +9 -0
- data/custom_facts/my_custom_os_fact.rb +8 -0
- data/docs/diagrams/facter_user_interaction.png +0 -0
- data/external_facts/my_external_fact.txt +1 -0
- data/fact_groups.conf +169 -0
- data/facter.conf +25 -0
- data/facter.gemspec +50 -0
- data/lib/custom_facts/core/aggregate.rb +206 -0
- data/lib/custom_facts/core/directed_graph.rb +47 -0
- data/lib/custom_facts/core/execution.rb +129 -0
- data/lib/custom_facts/core/execution/base.rb +100 -0
- data/lib/custom_facts/core/execution/posix.rb +55 -0
- data/lib/custom_facts/core/execution/windows.rb +70 -0
- data/lib/custom_facts/core/file_loader.rb +30 -0
- data/lib/custom_facts/core/legacy_facter.rb +208 -0
- data/lib/custom_facts/core/logging.rb +203 -0
- data/lib/custom_facts/core/resolvable.rb +103 -0
- data/lib/custom_facts/core/suitable.rb +110 -0
- data/lib/custom_facts/util/collection.rb +187 -0
- data/lib/custom_facts/util/composite_loader.rb +18 -0
- data/lib/custom_facts/util/config.rb +96 -0
- data/lib/custom_facts/util/confine.rb +70 -0
- data/lib/custom_facts/util/directory_loader.rb +85 -0
- data/lib/custom_facts/util/fact.rb +217 -0
- data/lib/custom_facts/util/loader.rb +155 -0
- data/lib/custom_facts/util/normalization.rb +95 -0
- data/lib/custom_facts/util/nothing_loader.rb +12 -0
- data/lib/custom_facts/util/parser.rb +193 -0
- data/lib/custom_facts/util/resolution.rb +166 -0
- data/lib/custom_facts/util/unix_root.rb +11 -0
- data/lib/custom_facts/util/values.rb +109 -0
- data/lib/custom_facts/util/windows_root.rb +11 -0
- data/lib/custom_facts/version.rb +85 -0
- data/lib/facter.rb +377 -0
- data/lib/facts/aix/augeas/version.rb +19 -0
- data/lib/facts/aix/facterversion.rb +15 -0
- data/lib/facts/aix/filesystems.rb +14 -0
- data/lib/facts/aix/hypervisors/lpar.rb +20 -0
- data/lib/facts/aix/hypervisors/wpar.rb +19 -0
- data/lib/facts/aix/identity/gid.rb +16 -0
- data/lib/facts/aix/identity/group.rb +18 -0
- data/lib/facts/aix/identity/privileged.rb +16 -0
- data/lib/facts/aix/identity/uid.rb +16 -0
- data/lib/facts/aix/identity/user.rb +17 -0
- data/lib/facts/aix/kernel.rb +15 -0
- data/lib/facts/aix/kernelmajversion.rb +16 -0
- data/lib/facts/aix/kernelrelease.rb +15 -0
- data/lib/facts/aix/kernelversion.rb +16 -0
- data/lib/facts/aix/load_averages.rb +14 -0
- data/lib/facts/aix/mountpoints.rb +15 -0
- data/lib/facts/aix/networking/domain.rb +17 -0
- data/lib/facts/aix/networking/fqdn.rb +17 -0
- data/lib/facts/aix/networking/hostname.rb +17 -0
- data/lib/facts/aix/networking/ip.rb +18 -0
- data/lib/facts/aix/networking/primary.rb +17 -0
- data/lib/facts/aix/nim_type.rb +15 -0
- data/lib/facts/aix/os/architecture.rb +18 -0
- data/lib/facts/aix/os/family.rb +18 -0
- data/lib/facts/aix/os/hardware.rb +18 -0
- data/lib/facts/aix/os/name.rb +18 -0
- data/lib/facts/aix/os/release.rb +21 -0
- data/lib/facts/aix/partitions.rb +15 -0
- data/lib/facts/aix/path.rb +14 -0
- data/lib/facts/aix/processors/count.rb +17 -0
- data/lib/facts/aix/processors/isa.rb +18 -0
- data/lib/facts/aix/processors/models.rb +16 -0
- data/lib/facts/aix/processors/speed.rb +17 -0
- data/lib/facts/aix/puppet_version.rb +15 -0
- data/lib/facts/aix/ruby/platform.rb +17 -0
- data/lib/facts/aix/ruby/sitedir.rb +17 -0
- data/lib/facts/aix/ruby/version.rb +17 -0
- data/lib/facts/aix/ssh.rb +34 -0
- data/lib/facts/aix/system_uptime/days.rb +17 -0
- data/lib/facts/aix/system_uptime/hours.rb +17 -0
- data/lib/facts/aix/system_uptime/seconds.rb +17 -0
- data/lib/facts/aix/system_uptime/uptime.rb +17 -0
- data/lib/facts/aix/timezone.rb +14 -0
- data/lib/facts/bsd/bsd_example_fact.rb +14 -0
- data/lib/facts/bsd/kernelmajversion.rb +16 -0
- data/lib/facts/bsd/kernelversion.rb +14 -0
- data/lib/facts/bsd/load_averages.rb +14 -0
- data/lib/facts/bsd/os/family.rb +18 -0
- data/lib/facts/debian/architecture.rb +20 -0
- data/lib/facts/debian/lsbdistcodename.rb +16 -0
- data/lib/facts/debian/lsbdistdescription.rb +16 -0
- data/lib/facts/debian/lsbdistid.rb +16 -0
- data/lib/facts/debian/os/distro/codename.rb +30 -0
- data/lib/facts/debian/os/distro/description.rb +19 -0
- data/lib/facts/debian/os/distro/id.rb +19 -0
- data/lib/facts/debian/os/distro/release.rb +33 -0
- data/lib/facts/debian/os/release.rb +36 -0
- data/lib/facts/freebsd/os/release.rb +43 -0
- data/lib/facts/linux/augeas/version.rb +19 -0
- data/lib/facts/linux/dhcp_servers.rb +27 -0
- data/lib/facts/linux/disks.rb +15 -0
- data/lib/facts/linux/dmi/bios/release_date.rb +19 -0
- data/lib/facts/linux/dmi/bios/vendor.rb +19 -0
- data/lib/facts/linux/dmi/bios/version.rb +19 -0
- data/lib/facts/linux/dmi/board/manufacturer.rb +19 -0
- data/lib/facts/linux/dmi/board/product.rb +19 -0
- data/lib/facts/linux/dmi/board/serial_number.rb +19 -0
- data/lib/facts/linux/dmi/chassis/asset_tag.rb +19 -0
- data/lib/facts/linux/dmi/chassis/type.rb +19 -0
- data/lib/facts/linux/dmi/manufacturer.rb +17 -0
- data/lib/facts/linux/dmi/product/name.rb +19 -0
- data/lib/facts/linux/dmi/product/serial_number.rb +19 -0
- data/lib/facts/linux/dmi/product/uuid.rb +19 -0
- data/lib/facts/linux/facterversion.rb +15 -0
- data/lib/facts/linux/filesystems.rb +14 -0
- data/lib/facts/linux/fips_enabled.rb +14 -0
- data/lib/facts/linux/hypervisors.rb +18 -0
- data/lib/facts/linux/identity/gid.rb +16 -0
- data/lib/facts/linux/identity/group.rb +18 -0
- data/lib/facts/linux/identity/privileged.rb +16 -0
- data/lib/facts/linux/identity/uid.rb +16 -0
- data/lib/facts/linux/identity/user.rb +17 -0
- data/lib/facts/linux/interfaces.rb +16 -0
- data/lib/facts/linux/ipaddress6_interfaces.rb +20 -0
- data/lib/facts/linux/ipaddress_interfaces.rb +20 -0
- data/lib/facts/linux/kernel.rb +15 -0
- data/lib/facts/linux/kernelmajversion.rb +24 -0
- data/lib/facts/linux/kernelrelease.rb +14 -0
- data/lib/facts/linux/kernelversion.rb +15 -0
- data/lib/facts/linux/load_averages.rb +14 -0
- data/lib/facts/linux/lsbdistrelease.rb +23 -0
- data/lib/facts/linux/macaddress_interfaces.rb +20 -0
- data/lib/facts/linux/memory/swap/available.rb +20 -0
- data/lib/facts/linux/memory/swap/available_bytes.rb +21 -0
- data/lib/facts/linux/memory/swap/capacity.rb +18 -0
- data/lib/facts/linux/memory/swap/total.rb +20 -0
- data/lib/facts/linux/memory/swap/total_bytes.rb +20 -0
- data/lib/facts/linux/memory/swap/used.rb +19 -0
- data/lib/facts/linux/memory/swap/used_bytes.rb +18 -0
- data/lib/facts/linux/memory/system/available.rb +21 -0
- data/lib/facts/linux/memory/system/available_bytes.rb +21 -0
- data/lib/facts/linux/memory/system/capacity.rb +18 -0
- data/lib/facts/linux/memory/system/total.rb +20 -0
- data/lib/facts/linux/memory/system/total_bytes.rb +20 -0
- data/lib/facts/linux/memory/system/used.rb +19 -0
- data/lib/facts/linux/memory/system/used_bytes.rb +18 -0
- data/lib/facts/linux/mountpoints.rb +21 -0
- data/lib/facts/linux/mtu_interfaces.rb +20 -0
- data/lib/facts/linux/netmask6_interfaces.rb +20 -0
- data/lib/facts/linux/netmask_interfaces.rb +20 -0
- data/lib/facts/linux/network6_interfaces.rb +20 -0
- data/lib/facts/linux/network_interfaces.rb +20 -0
- data/lib/facts/linux/networking/dhcp.rb +20 -0
- data/lib/facts/linux/networking/domain.rb +17 -0
- data/lib/facts/linux/networking/fqdn.rb +17 -0
- data/lib/facts/linux/networking/hostname.rb +17 -0
- data/lib/facts/linux/networking/interfaces.rb +16 -0
- data/lib/facts/linux/networking/ip.rb +21 -0
- data/lib/facts/linux/networking/ip6.rb +21 -0
- data/lib/facts/linux/networking/mac.rb +21 -0
- data/lib/facts/linux/networking/mtu.rb +20 -0
- data/lib/facts/linux/networking/netmask.rb +21 -0
- data/lib/facts/linux/networking/netmask6.rb +21 -0
- data/lib/facts/linux/networking/network.rb +21 -0
- data/lib/facts/linux/networking/network6.rb +21 -0
- data/lib/facts/linux/networking/primary.rb +17 -0
- data/lib/facts/linux/networking/scope6.rb +20 -0
- data/lib/facts/linux/os/architecture.rb +20 -0
- data/lib/facts/linux/os/distro/codename.rb +21 -0
- data/lib/facts/linux/os/distro/description.rb +21 -0
- data/lib/facts/linux/os/distro/id.rb +21 -0
- data/lib/facts/linux/os/distro/release.rb +31 -0
- data/lib/facts/linux/os/distro/specification.rb +21 -0
- data/lib/facts/linux/os/family.rb +20 -0
- data/lib/facts/linux/os/hardware.rb +18 -0
- data/lib/facts/linux/os/name.rb +18 -0
- data/lib/facts/linux/os/release.rb +20 -0
- data/lib/facts/linux/os/selinux/config_mode.rb +21 -0
- data/lib/facts/linux/os/selinux/config_policy.rb +21 -0
- data/lib/facts/linux/os/selinux/current_mode.rb +21 -0
- data/lib/facts/linux/os/selinux/enabled.rb +21 -0
- data/lib/facts/linux/os/selinux/enforced.rb +21 -0
- data/lib/facts/linux/os/selinux/policy_version.rb +21 -0
- data/lib/facts/linux/partitions.rb +26 -0
- data/lib/facts/linux/path.rb +15 -0
- data/lib/facts/linux/processor.rb +20 -0
- data/lib/facts/linux/processors/count.rb +17 -0
- data/lib/facts/linux/processors/isa.rb +26 -0
- data/lib/facts/linux/processors/models.rb +16 -0
- data/lib/facts/linux/processors/physicalcount.rb +17 -0
- data/lib/facts/linux/puppet_version.rb +15 -0
- data/lib/facts/linux/ruby/platform.rb +18 -0
- data/lib/facts/linux/ruby/sitedir.rb +18 -0
- data/lib/facts/linux/ruby/version.rb +18 -0
- data/lib/facts/linux/scope6_interfaces.rb +26 -0
- data/lib/facts/linux/ssh.rb +26 -0
- data/lib/facts/linux/sshalgorithmkey.rb +17 -0
- data/lib/facts/linux/sshfp_algorithm.rb +20 -0
- data/lib/facts/linux/system_uptime/days.rb +18 -0
- data/lib/facts/linux/system_uptime/hours.rb +18 -0
- data/lib/facts/linux/system_uptime/seconds.rb +18 -0
- data/lib/facts/linux/system_uptime/uptime.rb +18 -0
- data/lib/facts/linux/timezone.rb +14 -0
- data/lib/facts/linux/virtual.rb +23 -0
- data/lib/facts/macosx/augeas/version.rb +19 -0
- data/lib/facts/macosx/dmi/product/name.rb +19 -0
- data/lib/facts/macosx/facterversion.rb +15 -0
- data/lib/facts/macosx/filesystems.rb +14 -0
- data/lib/facts/macosx/identity/gid.rb +16 -0
- data/lib/facts/macosx/identity/group.rb +18 -0
- data/lib/facts/macosx/identity/privileged.rb +16 -0
- data/lib/facts/macosx/identity/uid.rb +16 -0
- data/lib/facts/macosx/identity/user.rb +17 -0
- data/lib/facts/macosx/interfaces.rb +15 -0
- data/lib/facts/macosx/is_virtual.rb +30 -0
- data/lib/facts/macosx/kernel.rb +14 -0
- data/lib/facts/macosx/kernelmajversion.rb +15 -0
- data/lib/facts/macosx/kernelrelease.rb +14 -0
- data/lib/facts/macosx/kernelversion.rb +14 -0
- data/lib/facts/macosx/load_averages.rb +14 -0
- data/lib/facts/macosx/memory/swap/available.rb +21 -0
- data/lib/facts/macosx/memory/swap/available_bytes.rb +20 -0
- data/lib/facts/macosx/memory/swap/capacity.rb +18 -0
- data/lib/facts/macosx/memory/swap/encrypted.rb +19 -0
- data/lib/facts/macosx/memory/swap/total.rb +21 -0
- data/lib/facts/macosx/memory/swap/total_bytes.rb +20 -0
- data/lib/facts/macosx/memory/swap/used.rb +20 -0
- data/lib/facts/macosx/memory/swap/used_bytes.rb +18 -0
- data/lib/facts/macosx/memory/system/available.rb +21 -0
- data/lib/facts/macosx/memory/system/available_bytes.rb +20 -0
- data/lib/facts/macosx/memory/system/capacity.rb +18 -0
- data/lib/facts/macosx/memory/system/total.rb +21 -0
- data/lib/facts/macosx/memory/system/total_bytes.rb +20 -0
- data/lib/facts/macosx/memory/system/used.rb +20 -0
- data/lib/facts/macosx/memory/system/used_bytes.rb +18 -0
- data/lib/facts/macosx/mountpoints.rb +16 -0
- data/lib/facts/macosx/networking/domain.rb +17 -0
- data/lib/facts/macosx/networking/fqdn.rb +17 -0
- data/lib/facts/macosx/networking/hostname.rb +17 -0
- data/lib/facts/macosx/networking/ip.rb +18 -0
- data/lib/facts/macosx/networking/mac.rb +18 -0
- data/lib/facts/macosx/os/architecture.rb +17 -0
- data/lib/facts/macosx/os/family.rb +18 -0
- data/lib/facts/macosx/os/hardware.rb +17 -0
- data/lib/facts/macosx/os/macosx/build.rb +19 -0
- data/lib/facts/macosx/os/macosx/product.rb +19 -0
- data/lib/facts/macosx/os/macosx/version.rb +25 -0
- data/lib/facts/macosx/os/name.rb +18 -0
- data/lib/facts/macosx/os/release.rb +26 -0
- data/lib/facts/macosx/path.rb +15 -0
- data/lib/facts/macosx/processors/count.rb +17 -0
- data/lib/facts/macosx/processors/isa.rb +17 -0
- data/lib/facts/macosx/processors/models.rb +21 -0
- data/lib/facts/macosx/processors/physicalcount.rb +17 -0
- data/lib/facts/macosx/processors/speed.rb +17 -0
- data/lib/facts/macosx/puppet_version.rb +15 -0
- data/lib/facts/macosx/ruby/platform.rb +17 -0
- data/lib/facts/macosx/ruby/sitedir.rb +17 -0
- data/lib/facts/macosx/ruby/version.rb +18 -0
- data/lib/facts/macosx/ssh.rb +26 -0
- data/lib/facts/macosx/sshalgorithmkey.rb +17 -0
- data/lib/facts/macosx/sshfp_algorithm.rb +20 -0
- data/lib/facts/macosx/system_profiler/boot_mode.rb +17 -0
- data/lib/facts/macosx/system_profiler/boot_rom_version.rb +17 -0
- data/lib/facts/macosx/system_profiler/boot_volume.rb +17 -0
- data/lib/facts/macosx/system_profiler/computer_name.rb +17 -0
- data/lib/facts/macosx/system_profiler/cores.rb +17 -0
- data/lib/facts/macosx/system_profiler/hardware_uuid.rb +17 -0
- data/lib/facts/macosx/system_profiler/kernel_version.rb +17 -0
- data/lib/facts/macosx/system_profiler/l2_cache_per_core.rb +17 -0
- data/lib/facts/macosx/system_profiler/l3_cache.rb +17 -0
- data/lib/facts/macosx/system_profiler/memory.rb +17 -0
- data/lib/facts/macosx/system_profiler/model_identifier.rb +17 -0
- data/lib/facts/macosx/system_profiler/model_name.rb +17 -0
- data/lib/facts/macosx/system_profiler/processor_name.rb +17 -0
- data/lib/facts/macosx/system_profiler/processor_speed.rb +17 -0
- data/lib/facts/macosx/system_profiler/processors.rb +17 -0
- data/lib/facts/macosx/system_profiler/secure_virtual_memory.rb +17 -0
- data/lib/facts/macosx/system_profiler/serial_number.rb +17 -0
- data/lib/facts/macosx/system_profiler/smc_version.rb +17 -0
- data/lib/facts/macosx/system_profiler/system_version.rb +17 -0
- data/lib/facts/macosx/system_profiler/uptime.rb +17 -0
- data/lib/facts/macosx/system_profiler/username.rb +17 -0
- data/lib/facts/macosx/system_uptime/days.rb +17 -0
- data/lib/facts/macosx/system_uptime/hours.rb +17 -0
- data/lib/facts/macosx/system_uptime/seconds.rb +17 -0
- data/lib/facts/macosx/system_uptime/uptime.rb +17 -0
- data/lib/facts/macosx/timezone.rb +14 -0
- data/lib/facts/rhel/os/distro/codename.rb +21 -0
- data/lib/facts/rhel/os/distro/description.rb +21 -0
- data/lib/facts/rhel/os/distro/id.rb +21 -0
- data/lib/facts/rhel/os/distro/release.rb +31 -0
- data/lib/facts/rhel/os/family.rb +16 -0
- data/lib/facts/rhel/os/name.rb +19 -0
- data/lib/facts/rhel/os/release.rb +36 -0
- data/lib/facts/sles/os/distro/codename.rb +21 -0
- data/lib/facts/sles/os/distro/description.rb +21 -0
- data/lib/facts/sles/os/distro/id.rb +21 -0
- data/lib/facts/sles/os/distro/release.rb +31 -0
- data/lib/facts/sles/os/family.rb +16 -0
- data/lib/facts/sles/os/release.rb +29 -0
- data/lib/facts/solaris/augeas/version.rb +19 -0
- data/lib/facts/solaris/facterversion.rb +14 -0
- data/lib/facts/solaris/filesystems.rb +14 -0
- data/lib/facts/solaris/identity/gid.rb +16 -0
- data/lib/facts/solaris/identity/group.rb +18 -0
- data/lib/facts/solaris/identity/privileged.rb +16 -0
- data/lib/facts/solaris/identity/uid.rb +16 -0
- data/lib/facts/solaris/identity/user.rb +17 -0
- data/lib/facts/solaris/kernel.rb +14 -0
- data/lib/facts/solaris/kernelmajversion.rb +16 -0
- data/lib/facts/solaris/kernelrelease.rb +14 -0
- data/lib/facts/solaris/kernelversion.rb +14 -0
- data/lib/facts/solaris/mountpoints.rb +21 -0
- data/lib/facts/solaris/networking/domain.rb +17 -0
- data/lib/facts/solaris/networking/fqdn.rb +17 -0
- data/lib/facts/solaris/networking/hostname.rb +17 -0
- data/lib/facts/solaris/networking/ip.rb +18 -0
- data/lib/facts/solaris/os/architecture.rb +18 -0
- data/lib/facts/solaris/os/family.rb +16 -0
- data/lib/facts/solaris/os/hardware.rb +18 -0
- data/lib/facts/solaris/os/name.rb +19 -0
- data/lib/facts/solaris/os/release.rb +22 -0
- data/lib/facts/solaris/path.rb +14 -0
- data/lib/facts/solaris/processors/count.rb +17 -0
- data/lib/facts/solaris/processors/isa.rb +17 -0
- data/lib/facts/solaris/processors/models.rb +21 -0
- data/lib/facts/solaris/processors/physicalcount.rb +17 -0
- data/lib/facts/solaris/processors/speed.rb +17 -0
- data/lib/facts/solaris/puppet_version.rb +15 -0
- data/lib/facts/solaris/ruby/platform.rb +18 -0
- data/lib/facts/solaris/ruby/sitedir.rb +17 -0
- data/lib/facts/solaris/ruby/version.rb +17 -0
- data/lib/facts/solaris/solaris_zones/current.rb +18 -0
- data/lib/facts/solaris/solaris_zones/zone.rb +62 -0
- data/lib/facts/solaris/ssh.rb +26 -0
- data/lib/facts/solaris/system_uptime/days.rb +18 -0
- data/lib/facts/solaris/system_uptime/hours.rb +18 -0
- data/lib/facts/solaris/system_uptime/seconds.rb +18 -0
- data/lib/facts/solaris/system_uptime/uptime.rb +18 -0
- data/lib/facts/solaris/timezone.rb +14 -0
- data/lib/facts/solaris/zfs_featurenumbers.rb +14 -0
- data/lib/facts/solaris/zfs_version.rb +14 -0
- data/lib/facts/solaris/zpool_featureflags.rb +14 -0
- data/lib/facts/solaris/zpool_featurenumbers.rb +14 -0
- data/lib/facts/solaris/zpool_version.rb +14 -0
- data/lib/facts/ubuntu/os/distro/release.rb +31 -0
- data/lib/facts/ubuntu/os/release.rb +20 -0
- data/lib/facts/windows/augeas/version.rb +19 -0
- data/lib/facts/windows/dhcp_servers.rb +26 -0
- data/lib/facts/windows/dmi/manufacturer.rb +18 -0
- data/lib/facts/windows/dmi/product/name.rb +20 -0
- data/lib/facts/windows/dmi/product/serial_number.rb +20 -0
- data/lib/facts/windows/dmi/product/uuid.rb +20 -0
- data/lib/facts/windows/facterversion.rb +15 -0
- data/lib/facts/windows/fips_enabled.rb +15 -0
- data/lib/facts/windows/hypervisors/hyperv.rb +24 -0
- data/lib/facts/windows/hypervisors/kvm.rb +36 -0
- data/lib/facts/windows/hypervisors/virtualbox.rb +37 -0
- data/lib/facts/windows/hypervisors/vmware.rb +24 -0
- data/lib/facts/windows/hypervisors/xen.rb +23 -0
- data/lib/facts/windows/identity/privileged.rb +17 -0
- data/lib/facts/windows/identity/user.rb +18 -0
- data/lib/facts/windows/interfaces.rb +15 -0
- data/lib/facts/windows/ipaddress6_interfaces.rb +20 -0
- data/lib/facts/windows/ipaddress_interfaces.rb +20 -0
- data/lib/facts/windows/kernel.rb +15 -0
- data/lib/facts/windows/kernelmajversion.rb +15 -0
- data/lib/facts/windows/kernelrelease.rb +15 -0
- data/lib/facts/windows/kernelversion.rb +15 -0
- data/lib/facts/windows/macaddress_interfaces.rb +20 -0
- data/lib/facts/windows/memory/system/available.rb +21 -0
- data/lib/facts/windows/memory/system/available_bytes.rb +21 -0
- data/lib/facts/windows/memory/system/capacity.rb +19 -0
- data/lib/facts/windows/memory/system/total.rb +21 -0
- data/lib/facts/windows/memory/system/total_bytes.rb +21 -0
- data/lib/facts/windows/memory/system/used.rb +20 -0
- data/lib/facts/windows/memory/system/used_bytes.rb +19 -0
- data/lib/facts/windows/mtu_interfaces.rb +20 -0
- data/lib/facts/windows/netmask6_interfaces.rb +20 -0
- data/lib/facts/windows/netmask_interfaces.rb +20 -0
- data/lib/facts/windows/network6_interfaces.rb +20 -0
- data/lib/facts/windows/network_interfaces.rb +20 -0
- data/lib/facts/windows/networking/dhcp.rb +17 -0
- data/lib/facts/windows/networking/domain.rb +18 -0
- data/lib/facts/windows/networking/fqdn.rb +22 -0
- data/lib/facts/windows/networking/hostname.rb +18 -0
- data/lib/facts/windows/networking/interfaces.rb +17 -0
- data/lib/facts/windows/networking/ip.rb +18 -0
- data/lib/facts/windows/networking/ip6.rb +18 -0
- data/lib/facts/windows/networking/mac.rb +18 -0
- data/lib/facts/windows/networking/mtu.rb +17 -0
- data/lib/facts/windows/networking/netmask.rb +18 -0
- data/lib/facts/windows/networking/netmask6.rb +18 -0
- data/lib/facts/windows/networking/network.rb +18 -0
- data/lib/facts/windows/networking/network6.rb +18 -0
- data/lib/facts/windows/networking/primary.rb +17 -0
- data/lib/facts/windows/networking/scope6.rb +17 -0
- data/lib/facts/windows/os/architecture.rb +18 -0
- data/lib/facts/windows/os/family.rb +18 -0
- data/lib/facts/windows/os/hardware.rb +18 -0
- data/lib/facts/windows/os/name.rb +18 -0
- data/lib/facts/windows/os/release.rb +35 -0
- data/lib/facts/windows/os/windows/edition_id.rb +20 -0
- data/lib/facts/windows/os/windows/installation_type.rb +20 -0
- data/lib/facts/windows/os/windows/product_name.rb +20 -0
- data/lib/facts/windows/os/windows/release_id.rb +20 -0
- data/lib/facts/windows/os/windows/system32.rb +20 -0
- data/lib/facts/windows/path.rb +15 -0
- data/lib/facts/windows/processor.rb +20 -0
- data/lib/facts/windows/processors/count.rb +18 -0
- data/lib/facts/windows/processors/isa.rb +18 -0
- data/lib/facts/windows/processors/models.rb +17 -0
- data/lib/facts/windows/processors/physicalcount.rb +18 -0
- data/lib/facts/windows/puppet_version.rb +15 -0
- data/lib/facts/windows/ruby/platform.rb +18 -0
- data/lib/facts/windows/ruby/sitedir.rb +18 -0
- data/lib/facts/windows/ruby/version.rb +18 -0
- data/lib/facts/windows/scope6_interfaces.rb +20 -0
- data/lib/facts/windows/ssh.rb +27 -0
- data/lib/facts/windows/system_uptime/days.rb +18 -0
- data/lib/facts/windows/system_uptime/hours.rb +18 -0
- data/lib/facts/windows/system_uptime/seconds.rb +18 -0
- data/lib/facts/windows/system_uptime/uptime.rb +18 -0
- data/lib/facts/windows/timezone.rb +15 -0
- data/lib/facts/windows/virtualization/is_virtual.rb +17 -0
- data/lib/facts/windows/virtualization/virtual.rb +17 -0
- data/lib/facts_utils/unit_converter.rb +59 -0
- data/lib/facts_utils/uptime_parser.rb +124 -0
- data/lib/facts_utils/windows_release_finder.rb +51 -0
- data/lib/framework/cli/cli.rb +140 -0
- data/lib/framework/cli/cli_launcher.rb +19 -0
- data/lib/framework/config/config_reader.rb +50 -0
- data/lib/framework/config/fact_groups.rb +56 -0
- data/lib/framework/core/cache_manager.rb +129 -0
- data/lib/framework/core/fact/external/external_fact_manager.rb +31 -0
- data/lib/framework/core/fact/internal/core_fact.rb +15 -0
- data/lib/framework/core/fact/internal/internal_fact_manager.rb +54 -0
- data/lib/framework/core/fact_augmenter.rb +37 -0
- data/lib/framework/core/fact_filter.rb +27 -0
- data/lib/framework/core/fact_loaders/class_discoverer.rb +32 -0
- data/lib/framework/core/fact_loaders/external_fact_loader.rb +45 -0
- data/lib/framework/core/fact_loaders/fact_loader.rb +72 -0
- data/lib/framework/core/fact_loaders/internal_fact_loader.rb +53 -0
- data/lib/framework/core/fact_manager.rb +64 -0
- data/lib/framework/core/file_loader.rb +58 -0
- data/lib/framework/core/options.rb +64 -0
- data/lib/framework/core/options/config_file_options.rb +92 -0
- data/lib/framework/core/options/option_store.rb +174 -0
- data/lib/framework/core/options/options_validator.rb +83 -0
- data/lib/framework/core/session_cache.rb +19 -0
- data/lib/framework/detector/os_detector.rb +73 -0
- data/lib/framework/detector/os_hierarchy.rb +53 -0
- data/lib/framework/formatters/formatter_factory.rb +13 -0
- data/lib/framework/formatters/formatter_helper.rb +39 -0
- data/lib/framework/formatters/hocon_fact_formatter.rb +50 -0
- data/lib/framework/formatters/json_fact_formatter.rb +35 -0
- data/lib/framework/formatters/legacy_fact_formatter.rb +91 -0
- data/lib/framework/formatters/yaml_fact_formatter.rb +64 -0
- data/lib/framework/logging/logger.rb +126 -0
- data/lib/framework/logging/logger_helper.rb +19 -0
- data/lib/framework/parsers/query_parser.rb +99 -0
- data/lib/framework/utils/utils.rb +37 -0
- data/lib/models/fact_collection.rb +45 -0
- data/lib/models/loaded_fact.rb +13 -0
- data/lib/models/resolved_fact.rb +28 -0
- data/lib/models/searched_fact.rb +15 -0
- data/lib/resolvers/agent_resolver.rb +23 -0
- data/lib/resolvers/aix/architecture_resolver.rb +39 -0
- data/lib/resolvers/aix/ffi/ffi_helper.rb +35 -0
- data/lib/resolvers/aix/filesystem_resolver.rb +34 -0
- data/lib/resolvers/aix/hardware_resolver.rb +39 -0
- data/lib/resolvers/aix/load_averages_resolver.rb +28 -0
- data/lib/resolvers/aix/mountpoints.rb +69 -0
- data/lib/resolvers/aix/networking_resolver.rb +34 -0
- data/lib/resolvers/aix/nim.rb +31 -0
- data/lib/resolvers/aix/os_level_resolver.rb +26 -0
- data/lib/resolvers/aix/partitions.rb +83 -0
- data/lib/resolvers/aix/processors.rb +80 -0
- data/lib/resolvers/aix/utils/odm_query.rb +42 -0
- data/lib/resolvers/augeas_resolver.rb +24 -0
- data/lib/resolvers/base_resolver.rb +33 -0
- data/lib/resolvers/bsd/ffi/ffi_helper.rb +25 -0
- data/lib/resolvers/bsd/load_averages_resolver.rb +26 -0
- data/lib/resolvers/debian_version.rb +29 -0
- data/lib/resolvers/disk_resolver.rb +54 -0
- data/lib/resolvers/dmi_resolver.rb +59 -0
- data/lib/resolvers/docker_lxc.rb +49 -0
- data/lib/resolvers/eos_release_resolver.rb +33 -0
- data/lib/resolvers/facterversion_resolver.rb +23 -0
- data/lib/resolvers/filesystems_resolver.rb +34 -0
- data/lib/resolvers/fips_enabled_resolver.rb +27 -0
- data/lib/resolvers/freebsd/freebsd_version_resolver.rb +37 -0
- data/lib/resolvers/hostname_resolver.rb +45 -0
- data/lib/resolvers/identity_resolver.rb +31 -0
- data/lib/resolvers/load_averages_resolver.rb +27 -0
- data/lib/resolvers/lpar_resolver.rb +31 -0
- data/lib/resolvers/lsb_release_resolver.rb +49 -0
- data/lib/resolvers/macosx/dmi_resolver.rb +28 -0
- data/lib/resolvers/macosx/filesystems_resolver.rb +32 -0
- data/lib/resolvers/macosx/ipaddress_resolver.rb +52 -0
- data/lib/resolvers/macosx/load_averages_resolver.rb +26 -0
- data/lib/resolvers/macosx/mountpoints_resolver.rb +61 -0
- data/lib/resolvers/macosx/processor_resolver.rb +58 -0
- data/lib/resolvers/macosx/swap_memory_resolver.rb +42 -0
- data/lib/resolvers/macosx/system_memory_resolver.rb +45 -0
- data/lib/resolvers/macosx/system_profiler_resolver.rb +62 -0
- data/lib/resolvers/memory_resolver.rb +59 -0
- data/lib/resolvers/mountpoints_resolver.rb +62 -0
- data/lib/resolvers/networking_linux_resolver.rb +163 -0
- data/lib/resolvers/os_level_resolver.rb +29 -0
- data/lib/resolvers/os_release_resolver.rb +67 -0
- data/lib/resolvers/partitions.rb +110 -0
- data/lib/resolvers/path_resolver.rb +22 -0
- data/lib/resolvers/processors_resolver.rb +63 -0
- data/lib/resolvers/puppet_version_resolver.rb +27 -0
- data/lib/resolvers/redhat_release_resolver.rb +55 -0
- data/lib/resolvers/ruby_resolver.rb +25 -0
- data/lib/resolvers/selinux_resolver.rb +69 -0
- data/lib/resolvers/solaris/filesystems_resolver.rb +32 -0
- data/lib/resolvers/solaris/ipaddress_resolver.rb +39 -0
- data/lib/resolvers/solaris/processors.rb +36 -0
- data/lib/resolvers/solaris/solaris_os_release_resolver.rb +42 -0
- data/lib/resolvers/solaris/solaris_zone_name.rb +28 -0
- data/lib/resolvers/solaris/zfs_resolver.rb +34 -0
- data/lib/resolvers/solaris/zone_resolver.rb +48 -0
- data/lib/resolvers/solaris/zpool_resolver.rb +36 -0
- data/lib/resolvers/ssh_resolver.rb +37 -0
- data/lib/resolvers/suse_release_resolver.rb +35 -0
- data/lib/resolvers/sw_vers_resolver.rb +30 -0
- data/lib/resolvers/timezone_resolver.rb +22 -0
- data/lib/resolvers/uname_resolver.rb +42 -0
- data/lib/resolvers/uptime_resolver.rb +57 -0
- data/lib/resolvers/utils/filesystem_helper.rb +41 -0
- data/lib/resolvers/utils/fingerprint.rb +11 -0
- data/lib/resolvers/utils/ssh.rb +13 -0
- data/lib/resolvers/utils/ssh_helper.rb +27 -0
- data/lib/resolvers/windows/dmi_bios_resolver.rb +41 -0
- data/lib/resolvers/windows/dmi_computersystem_resolver.rb +40 -0
- data/lib/resolvers/windows/ffi/ffi.rb +65 -0
- data/lib/resolvers/windows/ffi/hardware_ffi.rb +17 -0
- data/lib/resolvers/windows/ffi/identity_ffi.rb +15 -0
- data/lib/resolvers/windows/ffi/ip_adapter_addresses_lh.rb +161 -0
- data/lib/resolvers/windows/ffi/kernel_ffi.rb +14 -0
- data/lib/resolvers/windows/ffi/memory_ffi.rb +12 -0
- data/lib/resolvers/windows/ffi/network_utils.rb +65 -0
- data/lib/resolvers/windows/ffi/networking_ffi.rb +34 -0
- data/lib/resolvers/windows/ffi/os_version_info_ex.rb +17 -0
- data/lib/resolvers/windows/ffi/performance_information.rb +20 -0
- data/lib/resolvers/windows/ffi/system32_ffi.rb +18 -0
- data/lib/resolvers/windows/ffi/system_info.rb +30 -0
- data/lib/resolvers/windows/fips_resolver.rb +32 -0
- data/lib/resolvers/windows/hardware_architecture_resolver.rb +64 -0
- data/lib/resolvers/windows/identity_resolver.rb +57 -0
- data/lib/resolvers/windows/kernel_resolver.rb +42 -0
- data/lib/resolvers/windows/memory_resolver.rb +60 -0
- data/lib/resolvers/windows/netkvm_resolver.rb +33 -0
- data/lib/resolvers/windows/networking_resolver.rb +180 -0
- data/lib/resolvers/windows/processors_resolver.rb +64 -0
- data/lib/resolvers/windows/product_release_resolver.rb +36 -0
- data/lib/resolvers/windows/ssh.rb +47 -0
- data/lib/resolvers/windows/system32_resolver.rb +45 -0
- data/lib/resolvers/windows/uptime_resolver.rb +77 -0
- data/lib/resolvers/windows/utils/win32ole.rb +24 -0
- data/lib/resolvers/windows/virtualization_resolver.rb +66 -0
- data/lib/resolvers/windows/win_os_description_resolver.rb +31 -0
- data/lib/resolvers/wpar_resolver.rb +34 -0
- data/lib/util/api_debugger.rb +43 -0
- data/lib/util/file_helper.rb +33 -0
- data/os_hierarchy.json +37 -0
- data/tasks/commits.rake +31 -0
- data/tasks/create_fact.rake +19 -0
- data/tasks/fact_generator/fact.erb +14 -0
- data/tasks/fact_generator/fact_creator.rb +105 -0
- data/tasks/fact_generator/fact_spec.erb +18 -0
- data/tasks/fact_generator/facts.json +358 -0
- data/tasks/fact_generator/path.rb +10 -0
- data/tasks/fact_list_generator.rake +26 -0
- metadata +799 -0
data/Gemfile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
|
4
|
+
|
5
|
+
gemspec name: 'facter'
|
6
|
+
|
7
|
+
group(:release, optional: true) do
|
8
|
+
gem 'github_changelog_generator' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')
|
9
|
+
end
|
10
|
+
|
11
|
+
local_gemfile = File.expand_path('Gemfile.local', __dir__)
|
12
|
+
eval_gemfile(local_gemfile) if File.exist?(local_gemfile)
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2019 Puppet
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# facter-ng
|
2
|
+
|
3
|
+
[![Modules Status](https://github.com/puppetlabs/facter-ng/workflows/Acceptance%20tests/badge.svg?branch=master)](https://github.com/puppetlabs/facter-ng/actions)
|
4
|
+
[![Modules Status](https://github.com/puppetlabs/facter-ng/workflows/Unit%20tests/badge.svg?branch=master)](https://github.com/puppetlabs/facter-ng/actions)
|
5
|
+
[![Modules Status](https://github.com/puppetlabs/facter-ng/workflows/Checks/badge.svg?branch=master)](https://github.com/puppetlabs/facter-ng/actions)
|
6
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/bf43445f767f2d64170a/test_coverage)](https://codeclimate.com/github/puppetlabs/facter-ng/test_coverage)
|
7
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/bf43445f767f2d64170a/maintainability)](https://codeclimate.com/github/puppetlabs/facter-ng/maintainability)
|
8
|
+
[<img src="https://img.shields.io/badge/slack-puppet--dev-brightgreen?logo=slack">](https://puppetcommunity.slack.com/messages/C0W1X7ZAL)
|
9
|
+
|
10
|
+
|
11
|
+
Facter is a command-line tool that gathers basic facts about nodes (systems) such as hardware details, network settings, OS type and version, and more. These facts are made available as variables in your Puppet manifests and can be used to inform conditional expressions in Puppet.
|
12
|
+
|
13
|
+
## Supported platforms
|
14
|
+
* Linux
|
15
|
+
* macOS
|
16
|
+
* Windows
|
17
|
+
* Solaris
|
18
|
+
* AIX
|
19
|
+
|
20
|
+
## Requirements
|
21
|
+
* Ruby 2.3+
|
22
|
+
|
23
|
+
## Basic concepts
|
24
|
+
The project has three main parts, the framework, facts and resolvers.
|
25
|
+
In the framework we implement functionality that is agnostic of specific facts like parsing user input, formatting output, etc.
|
26
|
+
|
27
|
+
Facts are the nuggets of information that will be provided by facter e.g. `os.name`, `networking.interfaces`, etc.
|
28
|
+
|
29
|
+
Resolvers have the role of gathering data from the system.
|
30
|
+
For example a resolver can execute a command on the system, can read a file or any operation that retries some data from a single source on the system.
|
31
|
+
|
32
|
+
![Facter user interaction](docs/diagrams/facter_user_interaction.png?raw=true)
|
33
|
+
|
34
|
+
## Getting started
|
35
|
+
After cloning the project, run `bundle install` to install all dependencies.
|
36
|
+
|
37
|
+
You can run facter by executing `./bin/facter`.
|
38
|
+
The command will output all the facts that facter detected for the current os.
|
39
|
+
|
40
|
+
In order to generate a fact, we can use the rake task `rake 'create_fact[<os>,<fact_name>]'` e.g. `rake 'create_fact[ubuntu,facterversion]'`
|
41
|
+
When generating a fact, the unit test for that fact is also generated. Facts should call on or more resolvers in order to obtain the data they need.
|
42
|
+
|
43
|
+
The implementation can be validated locally by running the `./check.sh` script.
|
44
|
+
|
45
|
+
## Goals - fast, easy, compatible
|
46
|
+
* Gain performance similar to the C++ version of Facter. We plan to achieve this goal by gathering multiple facts with only one call and by using the faster Win32 API rather than WMI for the Windows implementation.
|
47
|
+
* Facilitate community contribution. At the moment, C++ presents a possible impediment for community contributions.
|
48
|
+
* Enable native integration with other Ruby-based projects such as Bolt and puppet.
|
49
|
+
* Enable native integration for custom facts.
|
50
|
+
* Provide 100% compatibility with C++ Facter (drop-in replacement).
|
data/Rakefile
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'bundler/gem_tasks'
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
|
6
|
+
RSpec::Core::RakeTask.new(:spec)
|
7
|
+
Dir.glob(File.join('tasks/**/*.rake')).each { |file| load file }
|
8
|
+
|
9
|
+
task default: :spec
|
10
|
+
|
11
|
+
def retrieve_from_keyboard
|
12
|
+
return unless ARGV.include?('changelog')
|
13
|
+
|
14
|
+
puts "Please provide the next release tag:\n"
|
15
|
+
next_version = $stdin.gets.chomp
|
16
|
+
raise(ArgumentError, ' The string that you entered is invalid!') unless /[0-9]+\.[0-9]+\.[0-9]+/.match?(next_version)
|
17
|
+
|
18
|
+
next_version
|
19
|
+
end
|
20
|
+
|
21
|
+
if Bundler.rubygems.find_name('github_changelog_generator').any?
|
22
|
+
require 'github_changelog_generator/task'
|
23
|
+
|
24
|
+
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
|
25
|
+
if Rake.application.top_level_tasks.include?('changelog') &&
|
26
|
+
ENV['CHANGELOG_GITHUB_TOKEN'].nil?
|
27
|
+
raise 'Set CHANGELOG_GITHUB_TOKEN environment variable' /
|
28
|
+
" eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'"
|
29
|
+
end
|
30
|
+
|
31
|
+
config.user = 'puppetlabs'
|
32
|
+
config.project = 'facter-ng'
|
33
|
+
config.since_tag = File.read('VERSION').strip
|
34
|
+
config.future_release = retrieve_from_keyboard
|
35
|
+
config.exclude_labels = ['maintenance']
|
36
|
+
config.add_pr_wo_labels = true
|
37
|
+
config.issues = false
|
38
|
+
config.max_issues = 100
|
39
|
+
config.header = ''
|
40
|
+
config.base = 'CHANGELOG.md'
|
41
|
+
config.merge_prefix = '### UNCATEGORIZED PRS; GO LABEL THEM'
|
42
|
+
config.configure_sections = {
|
43
|
+
"Changed": {
|
44
|
+
"prefix": '### Changed',
|
45
|
+
"labels": ['backwards-incompatible']
|
46
|
+
},
|
47
|
+
"Added": {
|
48
|
+
"prefix": '### Added',
|
49
|
+
"labels": ['feature']
|
50
|
+
},
|
51
|
+
"Fixed": {
|
52
|
+
"prefix": '### Fixed',
|
53
|
+
"labels": ['bugfix']
|
54
|
+
}
|
55
|
+
}
|
56
|
+
end
|
57
|
+
else
|
58
|
+
desc 'Generate a Changelog from GitHub'
|
59
|
+
task :changelog do
|
60
|
+
raise <<~ERRORMESSAGE
|
61
|
+
The changelog tasks depends on github_changelog_generator gem.
|
62
|
+
Please install github_changelog_generator:
|
63
|
+
---
|
64
|
+
Gemfile:
|
65
|
+
optional:
|
66
|
+
':release':
|
67
|
+
- gem: 'github_changelog_generator'
|
68
|
+
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')"
|
69
|
+
ERRORMESSAGE
|
70
|
+
end
|
71
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
4.0.23
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('../lib', __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require_relative '../config/config'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = 'facter-ng'
|
9
|
+
spec.version = FACTER_VERSION
|
10
|
+
spec.authors = ['Puppet']
|
11
|
+
spec.email = ['team-nw@puppet.com']
|
12
|
+
|
13
|
+
spec.summary = 'New version of Facter'
|
14
|
+
spec.description = 'New version of Facter'
|
15
|
+
|
16
|
+
# Specify which files should be added to the gem when it is released.
|
17
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
18
|
+
spec.files = if system('git --help > /dev/null')
|
19
|
+
`git ls-files -z`.split("\x0")
|
20
|
+
else
|
21
|
+
Dir.glob('**/*')
|
22
|
+
end
|
23
|
+
|
24
|
+
spec.required_ruby_version = '~> 2.3'
|
25
|
+
spec.files.reject! do |f|
|
26
|
+
f.match(%r{^(test|spec|features)/})
|
27
|
+
end
|
28
|
+
|
29
|
+
spec.files.reject! do |f|
|
30
|
+
f == 'bin/facter'
|
31
|
+
end
|
32
|
+
|
33
|
+
spec.bindir = 'bin'
|
34
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
35
|
+
spec.require_paths = ['agent/lib']
|
36
|
+
|
37
|
+
spec.add_development_dependency 'bundler', '~> 2.0'
|
38
|
+
spec.add_development_dependency 'coveralls', '~> 0.8.23'
|
39
|
+
spec.add_development_dependency 'rake', '>= 12.3.3'
|
40
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
41
|
+
spec.add_development_dependency 'rubocop', '~> 0.74.0'
|
42
|
+
spec.add_development_dependency 'rubycritic', '~> 4.1.0'
|
43
|
+
|
44
|
+
spec.add_runtime_dependency 'ffi', '~> 1.9'
|
45
|
+
spec.add_runtime_dependency 'hocon', '~> 1.3'
|
46
|
+
spec.add_runtime_dependency 'sys-filesystem', '~> 1.3' unless Gem.win_platform?
|
47
|
+
spec.add_runtime_dependency 'thor', ['>= 1.0.1', '< 2.0']
|
48
|
+
end
|
data/bin/facter
ADDED
data/check.sh
ADDED
data/config/config.rb
ADDED
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
my_external_fact=123
|
data/fact_groups.conf
ADDED
@@ -0,0 +1,169 @@
|
|
1
|
+
{
|
2
|
+
"EC2": [
|
3
|
+
"ec2_metadata",
|
4
|
+
"ec2_userdata"
|
5
|
+
],
|
6
|
+
"GCE": [
|
7
|
+
"gce"
|
8
|
+
],
|
9
|
+
"augeas": [
|
10
|
+
"augeas",
|
11
|
+
"augeasversion"
|
12
|
+
],
|
13
|
+
"desktop management interface": [
|
14
|
+
"dmi",
|
15
|
+
"bios_vendor",
|
16
|
+
"bios_version",
|
17
|
+
"bios_release_date",
|
18
|
+
"boardassettag",
|
19
|
+
"boardmanufacturer",
|
20
|
+
"boardproductname",
|
21
|
+
"boardserialnumber",
|
22
|
+
"chassisassettag",
|
23
|
+
"manufacturer",
|
24
|
+
"productname",
|
25
|
+
"serialnumber",
|
26
|
+
"uuid",
|
27
|
+
"chassistype"
|
28
|
+
],
|
29
|
+
"file system": [
|
30
|
+
"mountpoints",
|
31
|
+
"filesystems",
|
32
|
+
"partitions"
|
33
|
+
],
|
34
|
+
"hypervisors": [
|
35
|
+
"hypervisors"
|
36
|
+
],
|
37
|
+
"id": [
|
38
|
+
"id",
|
39
|
+
"gid",
|
40
|
+
"identity"
|
41
|
+
],
|
42
|
+
"kernel": [
|
43
|
+
"kernel",
|
44
|
+
"kernelversion",
|
45
|
+
"kernelrelease",
|
46
|
+
"kernelmajversion"
|
47
|
+
],
|
48
|
+
"load_average": [
|
49
|
+
"load_averages"
|
50
|
+
],
|
51
|
+
"memory": [
|
52
|
+
"memory",
|
53
|
+
"memoryfree",
|
54
|
+
"memoryfree_mb",
|
55
|
+
"memorysize",
|
56
|
+
"memorysize_mb",
|
57
|
+
"swapfree",
|
58
|
+
"swapfree_mb",
|
59
|
+
"swapsize",
|
60
|
+
"swapsize_mb",
|
61
|
+
"swapencrypted"
|
62
|
+
],
|
63
|
+
"networking": [
|
64
|
+
"networking",
|
65
|
+
"hostname",
|
66
|
+
"ipaddress",
|
67
|
+
"ipaddress6",
|
68
|
+
"netmask",
|
69
|
+
"netmask6",
|
70
|
+
"network",
|
71
|
+
"network6",
|
72
|
+
"macaddress",
|
73
|
+
"interfaces",
|
74
|
+
"domain",
|
75
|
+
"fqdn",
|
76
|
+
"dhcp_servers"
|
77
|
+
],
|
78
|
+
"operating system": [
|
79
|
+
"os",
|
80
|
+
"operatingsystem",
|
81
|
+
"osfamily",
|
82
|
+
"operatingsystemrelease",
|
83
|
+
"operatingsystemmajrelease",
|
84
|
+
"hardwaremodel",
|
85
|
+
"architecture",
|
86
|
+
"lsbdistid",
|
87
|
+
"lsbdistrelease",
|
88
|
+
"lsbdistcodename",
|
89
|
+
"lsbdistdescription",
|
90
|
+
"lsbmajdistrelease",
|
91
|
+
"lsbminordistrelease",
|
92
|
+
"lsbrelease",
|
93
|
+
"macosx_buildversion",
|
94
|
+
"macosx_productname",
|
95
|
+
"macosx_productversion",
|
96
|
+
"macosx_productversion_major",
|
97
|
+
"macosx_productversion_minor",
|
98
|
+
"windows_edition_id",
|
99
|
+
"windows_installation_type",
|
100
|
+
"windows_product_name",
|
101
|
+
"windows_release_id",
|
102
|
+
"system32",
|
103
|
+
"selinux",
|
104
|
+
"selinux_enforced",
|
105
|
+
"selinux_policyversion",
|
106
|
+
"selinux_current_mode",
|
107
|
+
"selinux_config_mode",
|
108
|
+
"selinux_config_policy"
|
109
|
+
],
|
110
|
+
"path": [
|
111
|
+
"path"
|
112
|
+
],
|
113
|
+
"processor": [
|
114
|
+
"processors",
|
115
|
+
"processorcount",
|
116
|
+
"physicalprocessorcount",
|
117
|
+
"hardwareisa"
|
118
|
+
],
|
119
|
+
"ssh": [
|
120
|
+
"ssh",
|
121
|
+
"sshdsakey",
|
122
|
+
"sshrsakey",
|
123
|
+
"sshecdsakey",
|
124
|
+
"sshed25519key",
|
125
|
+
"sshfp_dsa",
|
126
|
+
"sshfp_rsa",
|
127
|
+
"sshfp_ecdsa",
|
128
|
+
"sshfp_ed25519"
|
129
|
+
],
|
130
|
+
"system profiler": [
|
131
|
+
"system_profiler",
|
132
|
+
"sp_boot_mode",
|
133
|
+
"sp_boot_rom_version",
|
134
|
+
"sp_boot_volume",
|
135
|
+
"sp_cpu_type",
|
136
|
+
"sp_current_processor_speed",
|
137
|
+
"sp_kernel_version",
|
138
|
+
"sp_l2_cache_core",
|
139
|
+
"sp_l3_cache",
|
140
|
+
"sp_local_host_name",
|
141
|
+
"sp_machine_model",
|
142
|
+
"sp_machine_name",
|
143
|
+
"sp_number_processors",
|
144
|
+
"sp_os_version",
|
145
|
+
"sp_packages",
|
146
|
+
"sp_physical_memory",
|
147
|
+
"sp_platform_uuid",
|
148
|
+
"sp_secure_vm",
|
149
|
+
"sp_serial_number",
|
150
|
+
"sp_smc_version_system",
|
151
|
+
"sp_uptime",
|
152
|
+
"sp_user_name"
|
153
|
+
],
|
154
|
+
"timezone": [
|
155
|
+
"timezone"
|
156
|
+
],
|
157
|
+
"uptime": [
|
158
|
+
"system_uptime",
|
159
|
+
"uptime",
|
160
|
+
"uptime_days",
|
161
|
+
"uptime_hours",
|
162
|
+
"uptime_seconds"
|
163
|
+
],
|
164
|
+
"virtualization": [
|
165
|
+
"virtual",
|
166
|
+
"is_virtual",
|
167
|
+
"cloud"
|
168
|
+
]
|
169
|
+
}
|
data/facter.conf
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
facts : {
|
2
|
+
blocklist : [ "file system", "EC2", "os.name" ],
|
3
|
+
ttls : [
|
4
|
+
{ "timezone" : 30 days },
|
5
|
+
]
|
6
|
+
}
|
7
|
+
global : {
|
8
|
+
external-dir : [ "./external_facts"],
|
9
|
+
custom-dir : [ "./custom-facts", "./custom-facts2" ],
|
10
|
+
no-external-facts : false,
|
11
|
+
no-custom-facts : false,
|
12
|
+
no-ruby : false
|
13
|
+
show-legacy : false
|
14
|
+
}
|
15
|
+
|
16
|
+
cli : {
|
17
|
+
debug : false,
|
18
|
+
trace : true,
|
19
|
+
verbose : false,
|
20
|
+
log-level : "warn"
|
21
|
+
}
|
22
|
+
|
23
|
+
fact-groups : {
|
24
|
+
cached-custom-facts : ["my_custom_fact"],
|
25
|
+
}
|