facter 4.0.31 → 4.0.36
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/facter/custom_facts/util/directory_loader.rb +13 -1
- data/lib/facter/fact_groups.conf +140 -1
- data/lib/facter/facts/aix/disks.rb +17 -2
- data/lib/facter/facts/aix/networking/scope6.rb +3 -1
- data/lib/facter/facts/aix/scope6_interfaces.rb +0 -2
- data/lib/facter/facts/aix/serialnumber.rb +20 -0
- data/lib/facter/facts/aix/ssh.rb +3 -1
- data/lib/facter/facts/aix/sshalgorithmkey.rb +17 -0
- data/lib/facter/facts/aix/sshfp_algorithm.rb +20 -0
- data/lib/facter/facts/bsd/load_averages.rb +1 -1
- data/lib/facter/facts/debian/os/distro/release.rb +6 -1
- data/lib/facter/facts/freebsd/augeas/version.rb +19 -0
- data/lib/facter/facts/freebsd/dmi/bios/release_date.rb +19 -0
- data/lib/facter/facts/freebsd/dmi/bios/vendor.rb +19 -0
- data/lib/facter/facts/freebsd/dmi/bios/version.rb +19 -0
- data/lib/facter/facts/freebsd/dmi/manufacturer.rb +17 -0
- data/lib/facter/facts/freebsd/dmi/product/name.rb +19 -0
- data/lib/facter/facts/freebsd/dmi/product/serial_number.rb +19 -0
- data/lib/facter/facts/freebsd/dmi/product/uuid.rb +19 -0
- data/lib/facter/facts/freebsd/facterversion.rb +14 -0
- data/lib/facter/facts/freebsd/identity/gid.rb +16 -0
- data/lib/facter/facts/{solaris/solaris_zones/current.rb → freebsd/identity/group.rb} +6 -6
- data/lib/facter/facts/freebsd/identity/privileged.rb +16 -0
- data/lib/facter/facts/freebsd/identity/uid.rb +16 -0
- data/lib/facter/facts/freebsd/identity/user.rb +17 -0
- data/lib/facter/facts/freebsd/kernel.rb +14 -0
- data/lib/facter/facts/freebsd/kernelrelease.rb +14 -0
- data/lib/facter/facts/freebsd/memory/swap/available.rb +21 -0
- data/lib/facter/facts/freebsd/memory/swap/available_bytes.rb +20 -0
- data/lib/facter/facts/freebsd/memory/swap/capacity.rb +18 -0
- data/lib/facter/facts/freebsd/memory/swap/encrypted.rb +19 -0
- data/lib/facter/facts/freebsd/memory/swap/total.rb +21 -0
- data/lib/facter/facts/freebsd/memory/swap/total_bytes.rb +20 -0
- data/lib/facter/facts/freebsd/memory/swap/used.rb +20 -0
- data/lib/facter/facts/freebsd/memory/swap/used_bytes.rb +18 -0
- data/lib/facter/facts/freebsd/memory/system/available.rb +21 -0
- data/lib/facter/facts/freebsd/memory/system/available_bytes.rb +20 -0
- data/lib/facter/facts/freebsd/memory/system/capacity.rb +18 -0
- data/lib/facter/facts/freebsd/memory/system/total.rb +21 -0
- data/lib/facter/facts/freebsd/memory/system/total_bytes.rb +20 -0
- data/lib/facter/facts/freebsd/memory/system/used.rb +20 -0
- data/lib/facter/facts/freebsd/memory/system/used_bytes.rb +18 -0
- data/lib/facter/facts/freebsd/mountpoints.rb +21 -0
- data/lib/facter/facts/freebsd/netmask6_interfaces.rb +20 -0
- data/lib/facter/facts/freebsd/netmask_interfaces.rb +20 -0
- data/lib/facter/facts/freebsd/network6_interfaces.rb +20 -0
- data/lib/facter/facts/freebsd/network_interfaces.rb +20 -0
- data/lib/facter/facts/freebsd/networking/dhcp.rb +17 -0
- data/lib/facter/facts/freebsd/networking/domain.rb +18 -0
- data/lib/facter/facts/freebsd/networking/fqdn.rb +18 -0
- data/lib/facter/facts/freebsd/networking/hostname.rb +18 -0
- data/lib/facter/facts/freebsd/networking/interfaces.rb +17 -0
- data/lib/facter/facts/freebsd/networking/ip.rb +18 -0
- data/lib/facter/facts/freebsd/networking/ip6.rb +18 -0
- data/lib/facter/facts/freebsd/networking/mac.rb +18 -0
- data/lib/facter/facts/freebsd/networking/mtu.rb +17 -0
- data/lib/facter/facts/freebsd/networking/netmask.rb +18 -0
- data/lib/facter/facts/freebsd/networking/netmask6.rb +18 -0
- data/lib/facter/facts/freebsd/networking/network.rb +18 -0
- data/lib/facter/facts/freebsd/networking/network6.rb +18 -0
- data/lib/facter/facts/freebsd/networking/primary.rb +17 -0
- data/lib/facter/facts/freebsd/networking/scope6.rb +17 -0
- data/lib/facter/facts/freebsd/os/architecture.rb +18 -0
- data/lib/facter/facts/freebsd/os/hardware.rb +18 -0
- data/lib/facter/facts/freebsd/os/name.rb +18 -0
- data/lib/facter/facts/{bsd/bsd_example_fact.rb → freebsd/path.rb} +5 -4
- data/lib/facter/facts/freebsd/processors/isa.rb +17 -0
- data/lib/facter/facts/freebsd/puppet_version.rb +15 -0
- data/lib/facter/facts/freebsd/ruby/platform.rb +18 -0
- data/lib/facter/facts/freebsd/ruby/sitedir.rb +18 -0
- data/lib/facter/facts/freebsd/ruby/version.rb +18 -0
- data/lib/facter/facts/freebsd/ssh.rb +26 -0
- data/lib/facter/facts/freebsd/sshalgorithmkey.rb +17 -0
- data/lib/facter/facts/freebsd/sshfp_algorithm.rb +20 -0
- data/lib/facter/facts/freebsd/system_uptime/days.rb +18 -0
- data/lib/facter/facts/freebsd/system_uptime/hours.rb +18 -0
- data/lib/facter/facts/freebsd/system_uptime/seconds.rb +18 -0
- data/lib/facter/facts/freebsd/system_uptime/uptime.rb +18 -0
- data/lib/facter/facts/freebsd/timezone.rb +15 -0
- data/lib/facter/facts/freebsd/zfs_featurenumbers.rb +14 -0
- data/lib/facter/facts/freebsd/zfs_version.rb +14 -0
- data/lib/facter/facts/freebsd/zpool_featureflags.rb +14 -0
- data/lib/facter/facts/freebsd/zpool_featurenumbers.rb +14 -0
- data/lib/facter/facts/freebsd/zpool_version.rb +14 -0
- data/lib/facter/facts/linux/disks.rb +20 -1
- data/lib/facter/facts/linux/dmi/board/asset_tag.rb +19 -0
- data/lib/facter/facts/linux/ec2_metadata.rb +5 -3
- data/lib/facter/facts/linux/ec2_userdata.rb +5 -3
- data/lib/facter/facts/linux/gce.rb +16 -0
- data/lib/facter/facts/linux/is_virtual.rb +1 -3
- data/lib/facter/facts/linux/mountpoints.rb +1 -1
- data/lib/facter/facts/linux/networking/scope6.rb +3 -1
- data/lib/facter/facts/linux/partitions.rb +1 -1
- data/lib/facter/facts/linux/processors/speed.rb +17 -0
- data/lib/facter/facts/linux/scope6_interfaces.rb +1 -2
- data/lib/facter/facts/linux/ssh.rb +19 -9
- data/lib/facter/facts/linux/sshfp_algorithm.rb +1 -1
- data/lib/facter/facts/linux/system_uptime/days.rb +7 -1
- data/lib/facter/facts/linux/system_uptime/hours.rb +7 -1
- data/lib/facter/facts/linux/system_uptime/seconds.rb +7 -1
- data/lib/facter/facts/linux/system_uptime/uptime.rb +7 -1
- data/lib/facter/facts/linux/virtual.rb +17 -0
- data/lib/facter/facts/linux/xen.rb +28 -0
- data/lib/facter/facts/macosx/dhcp_servers.rb +2 -2
- data/lib/facter/facts/macosx/interfaces.rb +1 -1
- data/lib/facter/facts/macosx/ipaddress6_interfaces.rb +1 -1
- data/lib/facter/facts/macosx/ipaddress_interfaces.rb +1 -1
- data/lib/facter/facts/macosx/macaddress_interfaces.rb +1 -1
- data/lib/facter/facts/macosx/mtu_interfaces.rb +1 -1
- data/lib/facter/facts/macosx/netmask6_interfaces.rb +1 -1
- data/lib/facter/facts/macosx/netmask_interfaces.rb +1 -1
- data/lib/facter/facts/macosx/network6_interfaces.rb +1 -1
- data/lib/facter/facts/macosx/network_interfaces.rb +1 -1
- data/lib/facter/facts/macosx/networking/dhcp.rb +1 -1
- data/lib/facter/facts/macosx/networking/interfaces.rb +1 -1
- data/lib/facter/facts/macosx/networking/ip.rb +1 -1
- data/lib/facter/facts/macosx/networking/ip6.rb +1 -1
- data/lib/facter/facts/macosx/networking/mac.rb +1 -1
- data/lib/facter/facts/macosx/networking/mtu.rb +1 -1
- data/lib/facter/facts/macosx/networking/netmask.rb +1 -1
- data/lib/facter/facts/macosx/networking/netmask6.rb +1 -1
- data/lib/facter/facts/macosx/networking/network.rb +1 -1
- data/lib/facter/facts/macosx/networking/network6.rb +1 -1
- data/lib/facter/facts/macosx/networking/primary.rb +1 -1
- data/lib/facter/facts/macosx/networking/scope6.rb +4 -2
- data/lib/facter/facts/macosx/scope6_interfaces.rb +1 -3
- data/lib/facter/facts/macosx/ssh.rb +19 -11
- data/lib/facter/facts/macosx/sshfp_algorithm.rb +1 -1
- data/lib/facter/facts/macosx/virtual.rb +1 -1
- data/lib/facter/facts/solaris/current_zone.rb +16 -0
- data/lib/facter/facts/solaris/disks.rb +33 -0
- data/lib/facter/facts/solaris/dmi/bios/release_date.rb +24 -0
- data/lib/facter/facts/solaris/dmi/bios/vendor.rb +24 -0
- data/lib/facter/facts/solaris/dmi/bios/version.rb +24 -0
- data/lib/facter/facts/solaris/dmi/chassis/asset_tag.rb +24 -0
- data/lib/facter/facts/solaris/dmi/chassis/type.rb +24 -0
- data/lib/facter/facts/solaris/dmi/manufacturer.rb +25 -0
- data/lib/facter/facts/solaris/dmi/product/name.rb +27 -0
- data/lib/facter/facts/solaris/dmi/product/serial_number.rb +27 -0
- data/lib/facter/facts/solaris/dmi/product/uuid.rb +24 -0
- data/lib/facter/facts/solaris/hypervisors/ldom.rb +24 -0
- data/lib/facter/facts/solaris/hypervisors/zone.rb +39 -0
- data/lib/facter/facts/solaris/is_virtual.rb +64 -0
- data/lib/facter/facts/solaris/kernelmajversion.rb +1 -1
- data/lib/facter/facts/solaris/ldom.rb +35 -0
- data/lib/facter/facts/solaris/load_averages.rb +14 -0
- data/lib/facter/facts/solaris/memory/swap/available.rb +22 -0
- data/lib/facter/facts/solaris/memory/swap/available_bytes.rb +22 -0
- data/lib/facter/facts/solaris/memory/swap/capacity.rb +20 -0
- data/lib/facter/facts/solaris/memory/swap/total.rb +22 -0
- data/lib/facter/facts/solaris/memory/swap/total_bytes.rb +22 -0
- data/lib/facter/facts/solaris/memory/swap/used.rb +21 -0
- data/lib/facter/facts/solaris/memory/swap/used_bytes.rb +19 -0
- data/lib/facter/facts/solaris/memory/system/available.rb +22 -0
- data/lib/facter/facts/solaris/memory/system/available_bytes.rb +22 -0
- data/lib/facter/facts/solaris/memory/system/capacity.rb +20 -0
- data/lib/facter/facts/solaris/memory/system/total.rb +22 -0
- data/lib/facter/facts/solaris/memory/system/total_bytes.rb +22 -0
- data/lib/facter/facts/solaris/memory/system/used.rb +21 -0
- data/lib/facter/facts/solaris/memory/system/used_bytes.rb +19 -0
- data/lib/facter/facts/solaris/mountpoints.rb +1 -1
- data/lib/facter/facts/solaris/os/release.rb +3 -3
- data/lib/facter/facts/solaris/ssh.rb +19 -9
- data/lib/facter/facts/solaris/sshalgorithmkey.rb +17 -0
- data/lib/facter/facts/solaris/sshfp_algorithm.rb +20 -0
- data/lib/facter/facts/solaris/virtual.rb +60 -0
- data/lib/facter/facts/solaris/zfs_featurenumbers.rb +1 -1
- data/lib/facter/facts/solaris/zfs_version.rb +1 -1
- data/lib/facter/facts/solaris/zones.rb +60 -0
- data/lib/facter/facts/solaris/zpool_featureflags.rb +1 -1
- data/lib/facter/facts/solaris/zpool_featurenumbers.rb +1 -1
- data/lib/facter/facts/solaris/zpool_version.rb +1 -1
- data/lib/facter/facts/windows/dhcp_servers.rb +2 -2
- data/lib/facter/facts/windows/ec2_metadata.rb +5 -3
- data/lib/facter/facts/windows/ec2_userdata.rb +5 -3
- data/lib/facter/facts/windows/gce.rb +16 -0
- data/lib/facter/facts/windows/interfaces.rb +1 -1
- data/lib/facter/facts/windows/ipaddress6_interfaces.rb +1 -1
- data/lib/facter/facts/windows/ipaddress_interfaces.rb +1 -1
- data/lib/facter/facts/windows/macaddress_interfaces.rb +1 -1
- data/lib/facter/facts/windows/mtu_interfaces.rb +1 -1
- data/lib/facter/facts/windows/netmask6_interfaces.rb +1 -1
- data/lib/facter/facts/windows/netmask_interfaces.rb +1 -1
- data/lib/facter/facts/windows/network6_interfaces.rb +1 -1
- data/lib/facter/facts/windows/network_interfaces.rb +1 -1
- data/lib/facter/facts/windows/networking/dhcp.rb +1 -1
- data/lib/facter/facts/windows/networking/domain.rb +1 -1
- data/lib/facter/facts/windows/networking/fqdn.rb +1 -1
- data/lib/facter/facts/windows/networking/interfaces.rb +1 -1
- data/lib/facter/facts/windows/networking/ip.rb +1 -1
- data/lib/facter/facts/windows/networking/ip6.rb +1 -1
- data/lib/facter/facts/windows/networking/mac.rb +1 -1
- data/lib/facter/facts/windows/networking/mtu.rb +1 -1
- data/lib/facter/facts/windows/networking/netmask.rb +1 -1
- data/lib/facter/facts/windows/networking/netmask6.rb +1 -1
- data/lib/facter/facts/windows/networking/network.rb +1 -1
- data/lib/facter/facts/windows/networking/network6.rb +1 -1
- data/lib/facter/facts/windows/networking/primary.rb +1 -1
- data/lib/facter/facts/windows/networking/scope6.rb +4 -2
- data/lib/facter/facts/windows/scope6_interfaces.rb +1 -1
- data/lib/facter/facts/windows/sshalgorithmkey.rb +22 -0
- data/lib/facter/facts/windows/sshfp_algorithm.rb +25 -0
- data/lib/facter/facts_utils/facts_utils.rb +2 -0
- data/lib/facter/framework/cli/cli.rb +16 -4
- data/lib/facter/framework/config/fact_groups.rb +13 -0
- data/lib/facter/framework/core/fact/internal/core_fact.rb +2 -0
- data/lib/facter/framework/core/fact/internal/internal_fact_manager.rb +10 -25
- data/lib/facter/framework/core/fact_filter.rb +13 -0
- data/lib/facter/framework/core/fact_loaders/fact_loader.rb +24 -1
- data/lib/facter/framework/detector/os_detector.rb +5 -1
- data/lib/facter/framework/formatters/legacy_fact_formatter.rb +8 -1
- data/lib/facter/framework/formatters/yaml_fact_formatter.rb +1 -1
- data/lib/facter/os_hierarchy.json +6 -7
- data/lib/facter/resolvers/aix/serialnumber.rb +37 -0
- data/lib/facter/resolvers/augeas_resolver.rb +19 -2
- data/lib/facter/resolvers/base_resolver.rb +1 -1
- data/lib/facter/resolvers/bsd/ffi/ffi_helper.rb +0 -10
- data/lib/facter/resolvers/dmi_resolver.rb +4 -3
- data/lib/facter/resolvers/ec2.rb +4 -18
- data/lib/facter/resolvers/filesystems_resolver.rb +1 -1
- data/lib/facter/resolvers/freebsd/dmi_resolver.rb +38 -0
- data/lib/facter/resolvers/freebsd/ffi/ffi_helper.rb +19 -0
- data/lib/facter/resolvers/freebsd/swap_memory_resolver.rb +39 -0
- data/lib/facter/resolvers/freebsd/system_memory_resolver.rb +41 -0
- data/lib/facter/resolvers/gce.rb +54 -0
- data/lib/facter/resolvers/linux/docker_uptime.rb +45 -0
- data/lib/facter/resolvers/{load_averages_resolver.rb → linux/load_averages.rb} +0 -1
- data/lib/facter/resolvers/load_averages.rb +26 -0
- data/lib/facter/resolvers/lspci.rb +2 -0
- data/lib/facter/resolvers/memory_resolver.rb +8 -1
- data/lib/facter/resolvers/mountpoints_resolver.rb +42 -44
- data/lib/facter/resolvers/networking_linux_resolver.rb +16 -1
- data/lib/facter/resolvers/networking_resolver.rb +106 -0
- data/lib/facter/resolvers/os_release_resolver.rb +1 -1
- data/lib/facter/resolvers/processors_resolver.rb +24 -2
- data/lib/facter/resolvers/redhat_release_resolver.rb +4 -3
- data/lib/facter/resolvers/solaris/disks.rb +51 -0
- data/lib/facter/resolvers/solaris/dmi.rb +57 -0
- data/lib/facter/resolvers/solaris/dmi_sparc.rb +47 -0
- data/lib/facter/resolvers/solaris/ffi/ffi.rb +5 -0
- data/lib/facter/resolvers/solaris/{filesystems_resolver.rb → filesystems.rb} +0 -0
- data/lib/facter/resolvers/solaris/{ipaddress_resolver.rb → ipaddress.rb} +0 -0
- data/lib/facter/resolvers/solaris/ldom.rb +70 -0
- data/lib/facter/resolvers/solaris/memory.rb +93 -0
- data/lib/facter/resolvers/solaris/{networking_resolver.rb → networking.rb} +2 -6
- data/lib/facter/resolvers/solaris/os_release.rb +44 -0
- data/lib/facter/resolvers/solaris/zone.rb +51 -0
- data/lib/facter/resolvers/solaris/zone_name.rb +31 -0
- data/lib/facter/resolvers/uptime_resolver.rb +1 -27
- data/lib/facter/resolvers/utils/ffi/load_averages.rb +27 -0
- data/lib/facter/resolvers/utils/http.rb +68 -0
- data/lib/facter/resolvers/utils/networking.rb +2 -0
- data/lib/facter/resolvers/utils/uptime_helper.rb +32 -0
- data/lib/facter/resolvers/windows/ffi/ffi.rb +1 -1
- data/lib/facter/resolvers/windows/networking_resolver.rb +100 -100
- data/lib/facter/resolvers/xen.rb +28 -0
- data/lib/facter/resolvers/zfs.rb +32 -0
- data/lib/facter/resolvers/zpool.rb +34 -0
- data/lib/facter/version.rb +1 -1
- metadata +144 -18
- data/lib/facter/facts/freebsd/solaris_zones/current.rb +0 -15
- data/lib/facter/facts/freebsd/solaris_zones/zone.rb +0 -15
- data/lib/facter/facts/solaris/solaris_zones/zone.rb +0 -62
- data/lib/facter/resolvers/bsd/load_averages_resolver.rb +0 -26
- data/lib/facter/resolvers/macosx/networking_resolver.rb +0 -108
- data/lib/facter/resolvers/solaris/solaris_os_release_resolver.rb +0 -42
- data/lib/facter/resolvers/solaris/solaris_zone_name.rb +0 -28
- data/lib/facter/resolvers/solaris/zfs_resolver.rb +0 -34
- data/lib/facter/resolvers/solaris/zone_resolver.rb +0 -48
- data/lib/facter/resolvers/solaris/zpool_resolver.rb +0 -36
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Solaris
|
5
|
+
module Dmi
|
6
|
+
module Product
|
7
|
+
class Name
|
8
|
+
FACT_NAME = 'dmi.product.name'
|
9
|
+
ALIASES = 'productname'
|
10
|
+
|
11
|
+
def call_the_resolver
|
12
|
+
fact_value = if isa == 'i386'
|
13
|
+
Facter::Resolvers::Solaris::Dmi.resolve(:product_name)
|
14
|
+
elsif isa == 'sparc'
|
15
|
+
Facter::Resolvers::Solaris::DmiSparc.resolve(:product_name)
|
16
|
+
end
|
17
|
+
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
18
|
+
end
|
19
|
+
|
20
|
+
def isa
|
21
|
+
Facter::Resolvers::Uname.resolve(:processor)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Solaris
|
5
|
+
module Dmi
|
6
|
+
module Product
|
7
|
+
class SerialNumber
|
8
|
+
FACT_NAME = 'dmi.product.serial_number'
|
9
|
+
ALIASES = 'serialnumber'
|
10
|
+
|
11
|
+
def call_the_resolver
|
12
|
+
fact_value = if isa == 'i386'
|
13
|
+
Facter::Resolvers::Solaris::Dmi.resolve(:serial_number)
|
14
|
+
elsif isa == 'sparc'
|
15
|
+
Facter::Resolvers::Solaris::DmiSparc.resolve(:serial_number)
|
16
|
+
end
|
17
|
+
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
18
|
+
end
|
19
|
+
|
20
|
+
def isa
|
21
|
+
Facter::Resolvers::Uname.resolve(:processor)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Solaris
|
5
|
+
module Dmi
|
6
|
+
module Product
|
7
|
+
class Uuid
|
8
|
+
FACT_NAME = 'dmi.product.uuid'
|
9
|
+
ALIASES = 'uuid'
|
10
|
+
|
11
|
+
def call_the_resolver
|
12
|
+
fact_value = nil
|
13
|
+
fact_value = Facter::Resolvers::Solaris::Dmi.resolve(:product_uuid) if isa == 'i386'
|
14
|
+
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
15
|
+
end
|
16
|
+
|
17
|
+
def isa
|
18
|
+
Facter::Resolvers::Uname.resolve(:processor)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Solaris
|
5
|
+
module Hypervisors
|
6
|
+
class Ldom
|
7
|
+
FACT_NAME = 'hypervisors.ldom'
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@log = Facter::Log.new(self)
|
11
|
+
end
|
12
|
+
|
13
|
+
def call_the_resolver
|
14
|
+
fact_value = %i[
|
15
|
+
chassis_serial control_domain domain_name
|
16
|
+
domain_uuid role_control role_io role_root role_service
|
17
|
+
].map! { |key| [key, Facter::Resolvers::Solaris::Ldom.resolve(key)] }.to_h
|
18
|
+
|
19
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Solaris
|
5
|
+
module Hypervisors
|
6
|
+
class Zone
|
7
|
+
FACT_NAME = 'hypervisors.zone'
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@log = Facter::Log.new(self)
|
11
|
+
end
|
12
|
+
|
13
|
+
def call_the_resolver
|
14
|
+
fact_value = current_zone
|
15
|
+
|
16
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
17
|
+
end
|
18
|
+
|
19
|
+
def current_zone
|
20
|
+
current_zone_name = Facter::Resolvers::Solaris::ZoneName.resolve(:current_zone_name)
|
21
|
+
return unless current_zone_name
|
22
|
+
|
23
|
+
zones = Facter::Resolvers::Solaris::Zone.resolve(:zone)
|
24
|
+
return nil unless zones
|
25
|
+
|
26
|
+
current_zone = zones.find { |r| r[:name] == current_zone_name }
|
27
|
+
|
28
|
+
{
|
29
|
+
brand: current_zone[:brand],
|
30
|
+
id: current_zone[:id],
|
31
|
+
ip_type: current_zone[:iptype],
|
32
|
+
name: current_zone[:name],
|
33
|
+
uuid: current_zone[:uuid]
|
34
|
+
}
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Solaris
|
5
|
+
class IsVirtual
|
6
|
+
FACT_NAME = 'is_virtual'
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@log = Facter::Log.new(self)
|
10
|
+
end
|
11
|
+
|
12
|
+
def call_the_resolver
|
13
|
+
@log.debug('Solaris Virtual Resolver')
|
14
|
+
|
15
|
+
fact_value = check_ldom || check_zone || check_xen || check_other_facts || 'physical'
|
16
|
+
|
17
|
+
@log.debug("Fact value is: #{fact_value}")
|
18
|
+
|
19
|
+
Facter::ResolvedFact.new(FACT_NAME, check_if_virtual(fact_value))
|
20
|
+
end
|
21
|
+
|
22
|
+
def check_ldom
|
23
|
+
@log.debug('Checking LDoms')
|
24
|
+
return unless Facter::Resolvers::Solaris::Ldom.resolve(:role_control) == 'false'
|
25
|
+
|
26
|
+
Facter::Resolvers::Solaris::Ldom.resolve(:role_impl)
|
27
|
+
end
|
28
|
+
|
29
|
+
def check_zone
|
30
|
+
@log.debug('Checking LDoms')
|
31
|
+
zone_name = Facter::Resolvers::Solaris::ZoneName.resolve(:current_zone_name)
|
32
|
+
|
33
|
+
return if zone_name == 'global'
|
34
|
+
|
35
|
+
'zone'
|
36
|
+
end
|
37
|
+
|
38
|
+
def check_xen
|
39
|
+
@log.debug('Checking XEN')
|
40
|
+
Facter::Resolvers::Xen.resolve(:vm)
|
41
|
+
end
|
42
|
+
|
43
|
+
def check_other_facts
|
44
|
+
isa = Facter::Resolvers::Uname.resolve(:processor)
|
45
|
+
klass = isa == 'sparc' ? 'DmiSparc' : 'Dmi'
|
46
|
+
|
47
|
+
product_name = Facter::Resolvers::Solaris.const_get(klass).resolve(:product_name)
|
48
|
+
bios_vendor = Facter::Resolvers::Solaris.const_get(klass).resolve(:bios_vendor)
|
49
|
+
|
50
|
+
return 'kvm' if bios_vendor&.include?('Amazon EC2')
|
51
|
+
|
52
|
+
return unless product_name
|
53
|
+
|
54
|
+
Facter::FactsUtils::HYPERVISORS_HASH.each { |key, value| return value if product_name.include?(key) }
|
55
|
+
|
56
|
+
nil
|
57
|
+
end
|
58
|
+
|
59
|
+
def check_if_virtual(found_vm)
|
60
|
+
Facter::FactsUtils::PHYSICAL_HYPERVISORS.count(found_vm).zero?
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -8,7 +8,7 @@ module Facts
|
|
8
8
|
def call_the_resolver
|
9
9
|
full_version = Facter::Resolvers::Uname.resolve(:kernelversion)
|
10
10
|
versions_split = full_version.split('.')
|
11
|
-
major_version = versions_split.length >
|
11
|
+
major_version = versions_split.length > 2 ? versions_split[0] + '.' + versions_split[1] : versions_split[0]
|
12
12
|
Facter::ResolvedFact.new(FACT_NAME, major_version)
|
13
13
|
end
|
14
14
|
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Solaris
|
5
|
+
class Ldom
|
6
|
+
FACT_NAME = 'ldom'
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@log = Facter::Log.new(self)
|
10
|
+
end
|
11
|
+
|
12
|
+
def call_the_resolver
|
13
|
+
fact_value = {
|
14
|
+
domainchassis: resolve(:chassis_serial),
|
15
|
+
domaincontrol: resolve(:control_domain),
|
16
|
+
domainname: resolve(:domain_name),
|
17
|
+
domainrole: {
|
18
|
+
control: resolve(:role_control),
|
19
|
+
impl: resolve(:role_impl),
|
20
|
+
io: resolve(:role_io),
|
21
|
+
root: resolve(:role_root),
|
22
|
+
service: resolve(:role_service)
|
23
|
+
},
|
24
|
+
domainuuid: resolve(:domain_uuid)
|
25
|
+
}
|
26
|
+
|
27
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
28
|
+
end
|
29
|
+
|
30
|
+
def resolve(key)
|
31
|
+
Facter::Resolvers::Solaris::Ldom.resolve(key)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Solaris
|
5
|
+
class LoadAverages
|
6
|
+
FACT_NAME = 'load_averages'
|
7
|
+
|
8
|
+
def call_the_resolver
|
9
|
+
fact_value = Facter::Resolvers::LoadAverages.resolve(:load_averages)
|
10
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Solaris
|
5
|
+
module Memory
|
6
|
+
module Swap
|
7
|
+
class Available
|
8
|
+
FACT_NAME = 'memory.swap.available'
|
9
|
+
ALIASES = 'swapfree'
|
10
|
+
|
11
|
+
def call_the_resolver
|
12
|
+
fact_value = Facter::Resolvers::Solaris::Memory.resolve(:swap)
|
13
|
+
if fact_value
|
14
|
+
fact_value = Facter::FactsUtils::UnitConverter.bytes_to_human_readable(fact_value[:available_bytes])
|
15
|
+
end
|
16
|
+
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Solaris
|
5
|
+
module Memory
|
6
|
+
module Swap
|
7
|
+
class AvailableBytes
|
8
|
+
FACT_NAME = 'memory.swap.available_bytes'
|
9
|
+
ALIASES = 'swapfree_mb'
|
10
|
+
|
11
|
+
def call_the_resolver
|
12
|
+
fact_value = Facter::Resolvers::Solaris::Memory.resolve(:swap)
|
13
|
+
fact_value = fact_value[:available_bytes] if fact_value
|
14
|
+
|
15
|
+
[Facter::ResolvedFact.new(FACT_NAME, fact_value),
|
16
|
+
Facter::ResolvedFact.new(ALIASES, Facter::FactsUtils::UnitConverter.bytes_to_mb(fact_value), :legacy)]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Solaris
|
5
|
+
module Memory
|
6
|
+
module Swap
|
7
|
+
class Capacity
|
8
|
+
FACT_NAME = 'memory.swap.capacity'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Solaris::Memory.resolve(:swap)
|
12
|
+
fact_value = fact_value[:capacity] if fact_value
|
13
|
+
|
14
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Solaris
|
5
|
+
module Memory
|
6
|
+
module Swap
|
7
|
+
class Total
|
8
|
+
FACT_NAME = 'memory.swap.total'
|
9
|
+
ALIASES = 'swapsize'
|
10
|
+
|
11
|
+
def call_the_resolver
|
12
|
+
fact_value = Facter::Resolvers::Solaris::Memory.resolve(:swap)
|
13
|
+
if fact_value
|
14
|
+
fact_value = Facter::FactsUtils::UnitConverter.bytes_to_human_readable(fact_value[:total_bytes])
|
15
|
+
end
|
16
|
+
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Solaris
|
5
|
+
module Memory
|
6
|
+
module Swap
|
7
|
+
class TotalBytes
|
8
|
+
FACT_NAME = 'memory.swap.total_bytes'
|
9
|
+
ALIASES = 'swapsize_mb'
|
10
|
+
|
11
|
+
def call_the_resolver
|
12
|
+
fact_value = Facter::Resolvers::Solaris::Memory.resolve(:swap)
|
13
|
+
fact_value = fact_value[:total_bytes] if fact_value
|
14
|
+
|
15
|
+
[Facter::ResolvedFact.new(FACT_NAME, fact_value),
|
16
|
+
Facter::ResolvedFact.new(ALIASES, Facter::FactsUtils::UnitConverter.bytes_to_mb(fact_value), :legacy)]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Solaris
|
5
|
+
module Memory
|
6
|
+
module Swap
|
7
|
+
class Used
|
8
|
+
FACT_NAME = 'memory.swap.used'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Solaris::Memory.resolve(:swap)
|
12
|
+
if fact_value
|
13
|
+
fact_value = Facter::FactsUtils::UnitConverter.bytes_to_human_readable(fact_value[:used_bytes])
|
14
|
+
end
|
15
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Solaris
|
5
|
+
module Memory
|
6
|
+
module Swap
|
7
|
+
class UsedBytes
|
8
|
+
FACT_NAME = 'memory.swap.used_bytes'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Solaris::Memory.resolve(:swap)
|
12
|
+
fact_value = fact_value[:used_bytes] if fact_value
|
13
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Solaris
|
5
|
+
module Memory
|
6
|
+
module System
|
7
|
+
class Available
|
8
|
+
FACT_NAME = 'memory.system.available'
|
9
|
+
ALIASES = 'memoryfree'
|
10
|
+
|
11
|
+
def call_the_resolver
|
12
|
+
fact_value = Facter::Resolvers::Solaris::Memory.resolve(:system)
|
13
|
+
if fact_value
|
14
|
+
fact_value = Facter::FactsUtils::UnitConverter.bytes_to_human_readable(fact_value[:available_bytes])
|
15
|
+
end
|
16
|
+
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|