facter 4.0.51 → 4.0.52
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/docs/generate_cli.rb +7 -0
- data/lib/facter.rb +57 -44
- data/lib/facter/custom_facts/core/aggregate.rb +9 -0
- data/lib/facter/custom_facts/core/resolvable.rb +11 -0
- data/lib/facter/custom_facts/util/resolution.rb +2 -0
- data/lib/facter/facts/amzn/lsbdistcodename.rb +16 -0
- data/lib/facter/facts/amzn/lsbdistdescription.rb +16 -0
- data/lib/facter/facts/amzn/lsbdistid.rb +16 -0
- data/lib/facter/facts/amzn/os/distro/codename.rb +24 -0
- data/lib/facter/facts/amzn/os/distro/description.rb +21 -0
- data/lib/facter/facts/amzn/os/distro/id.rb +21 -0
- data/lib/facter/facts/amzn/os/distro/release.rb +32 -0
- data/lib/facter/facts/linux/az_metadata.rb +27 -0
- data/lib/facter/facts/linux/cloud/provider.rb +17 -0
- data/lib/facter/facts/linux/dhcp_servers.rb +2 -2
- data/lib/facter/facts/linux/interfaces.rb +1 -1
- data/lib/facter/facts/linux/ipaddress6_interfaces.rb +1 -1
- data/lib/facter/facts/linux/ipaddress_interfaces.rb +1 -1
- data/lib/facter/facts/linux/macaddress_interfaces.rb +1 -1
- data/lib/facter/facts/linux/mtu_interfaces.rb +1 -1
- data/lib/facter/facts/linux/netmask6_interfaces.rb +1 -1
- data/lib/facter/facts/linux/netmask_interfaces.rb +1 -1
- data/lib/facter/facts/linux/network6_interfaces.rb +1 -1
- data/lib/facter/facts/linux/network_interfaces.rb +1 -1
- data/lib/facter/facts/linux/networking/dhcp.rb +1 -1
- data/lib/facter/facts/linux/networking/domain.rb +1 -1
- data/lib/facter/facts/linux/networking/fqdn.rb +1 -1
- data/lib/facter/facts/linux/networking/hostname.rb +1 -1
- data/lib/facter/facts/linux/networking/interfaces.rb +1 -1
- data/lib/facter/facts/linux/networking/ip.rb +1 -1
- data/lib/facter/facts/linux/networking/ip6.rb +1 -1
- data/lib/facter/facts/linux/networking/mac.rb +1 -1
- data/lib/facter/facts/linux/networking/mtu.rb +1 -1
- data/lib/facter/facts/linux/networking/netmask.rb +1 -1
- data/lib/facter/facts/linux/networking/netmask6.rb +1 -1
- data/lib/facter/facts/linux/networking/network.rb +1 -1
- data/lib/facter/facts/linux/networking/network6.rb +1 -1
- data/lib/facter/facts/linux/networking/primary.rb +1 -1
- data/lib/facter/facts/linux/networking/scope6.rb +1 -1
- data/lib/facter/facts/linux/scope6_interfaces.rb +1 -1
- data/lib/facter/facts/rhel/lsbdistcodename.rb +16 -0
- data/lib/facter/facts/rhel/lsbdistdescription.rb +16 -0
- data/lib/facter/facts/rhel/lsbdistid.rb +16 -0
- data/lib/facter/facts/rhel/os/distro/codename.rb +2 -4
- data/lib/facter/facts/rhel/os/distro/description.rb +2 -4
- data/lib/facter/facts/rhel/os/distro/id.rb +2 -4
- data/lib/facter/facts/rhel/os/distro/release.rb +13 -12
- data/lib/facter/facts/sles/lsbdistcodename.rb +16 -0
- data/lib/facter/facts/sles/lsbdistdescription.rb +16 -0
- data/lib/facter/facts/sles/lsbdistid.rb +16 -0
- data/lib/facter/facts/sles/os/distro/codename.rb +3 -4
- data/lib/facter/facts/sles/os/distro/description.rb +2 -5
- data/lib/facter/facts/sles/os/distro/id.rb +6 -5
- data/lib/facter/facts/sles/os/distro/release.rb +17 -12
- data/lib/facter/facts/ubuntu/lsbdistrelease.rb +2 -2
- data/lib/facter/facts/windows/az_metadata.rb +27 -0
- data/lib/facter/facts/windows/cloud/provider.rb +17 -0
- data/lib/facter/framework/cli/cli.rb +5 -5
- data/lib/facter/framework/config/config_reader.rb +2 -0
- data/lib/facter/framework/config/fact_groups.rb +25 -2
- data/lib/facter/framework/core/cache_manager.rb +5 -1
- data/lib/facter/framework/core/fact_filter.rb +3 -3
- data/lib/facter/framework/core/fact_loaders/fact_loader.rb +0 -1
- data/lib/facter/framework/core/fact_manager.rb +5 -3
- data/lib/facter/framework/core/options.rb +1 -2
- data/lib/facter/framework/core/options/option_store.rb +1 -3
- data/lib/facter/framework/parsers/query_parser.rb +13 -6
- data/lib/facter/resolvers/az.rb +39 -0
- data/lib/facter/resolvers/linux/hostname.rb +115 -0
- data/lib/facter/resolvers/linux/networking.rb +106 -0
- data/lib/facter/resolvers/redhat_release.rb +28 -12
- data/lib/facter/resolvers/solaris/ffi/functions.rb +1 -1
- data/lib/facter/templates/man.erb +8 -0
- data/lib/facter/util/linux/dhcp.rb +86 -0
- data/lib/facter/util/linux/routing_table.rb +60 -0
- data/lib/facter/util/linux/socket_parser.rb +114 -0
- data/lib/facter/util/resolvers/ffi/hostname.rb +70 -0
- data/lib/facter/version.rb +1 -1
- metadata +29 -7
- data/lib/facter/facts/linux/cloud.rb +0 -15
- data/lib/facter/resolvers/cloud.rb +0 -39
- data/lib/facter/resolvers/networking_linux.rb +0 -296
@@ -15,8 +15,8 @@ module Facts
|
|
15
15
|
private
|
16
16
|
|
17
17
|
def construct_addresses_hash
|
18
|
-
primary_dhcp = Facter::Resolvers::
|
19
|
-
interfaces = Facter::Resolvers::
|
18
|
+
primary_dhcp = Facter::Resolvers::Linux::Networking.resolve(:dhcp)
|
19
|
+
interfaces = Facter::Resolvers::Linux::Networking.resolve(:interfaces)
|
20
20
|
return unless interfaces
|
21
21
|
|
22
22
|
servers = { system: primary_dhcp }
|
@@ -7,7 +7,7 @@ module Facts
|
|
7
7
|
TYPE = :legacy
|
8
8
|
|
9
9
|
def call_the_resolver
|
10
|
-
fact_value = Facter::Resolvers::
|
10
|
+
fact_value = Facter::Resolvers::Linux::Networking.resolve(:interfaces)
|
11
11
|
|
12
12
|
Facter::ResolvedFact.new(FACT_NAME, fact_value && !fact_value.empty? ? fact_value.keys.sort.join(',') : nil,
|
13
13
|
:legacy)
|
@@ -8,7 +8,7 @@ module Facts
|
|
8
8
|
|
9
9
|
def call_the_resolver
|
10
10
|
arr = []
|
11
|
-
interfaces = Facter::Resolvers::
|
11
|
+
interfaces = Facter::Resolvers::Linux::Networking.resolve(:interfaces)
|
12
12
|
interfaces&.each do |interface_name, info|
|
13
13
|
arr << Facter::ResolvedFact.new("ipaddress6_#{interface_name}", info[:ip6], :legacy) if info[:ip6]
|
14
14
|
end
|
@@ -8,7 +8,7 @@ module Facts
|
|
8
8
|
|
9
9
|
def call_the_resolver
|
10
10
|
arr = []
|
11
|
-
interfaces = Facter::Resolvers::
|
11
|
+
interfaces = Facter::Resolvers::Linux::Networking.resolve(:interfaces)
|
12
12
|
interfaces&.each do |interface_name, info|
|
13
13
|
arr << Facter::ResolvedFact.new("ipaddress_#{interface_name}", info[:ip], :legacy) if info[:ip]
|
14
14
|
end
|
@@ -8,7 +8,7 @@ module Facts
|
|
8
8
|
|
9
9
|
def call_the_resolver
|
10
10
|
arr = []
|
11
|
-
interfaces = Facter::Resolvers::
|
11
|
+
interfaces = Facter::Resolvers::Linux::Networking.resolve(:interfaces)
|
12
12
|
interfaces&.each do |interface_name, info|
|
13
13
|
arr << Facter::ResolvedFact.new("macaddress_#{interface_name}", info[:mac], :legacy) if info[:mac]
|
14
14
|
end
|
@@ -8,7 +8,7 @@ module Facts
|
|
8
8
|
|
9
9
|
def call_the_resolver
|
10
10
|
arr = []
|
11
|
-
interfaces = Facter::Resolvers::
|
11
|
+
interfaces = Facter::Resolvers::Linux::Networking.resolve(:interfaces)
|
12
12
|
interfaces&.each do |interface_name, info|
|
13
13
|
arr << Facter::ResolvedFact.new("mtu_#{interface_name}", info[:mtu], :legacy) if info[:mtu]
|
14
14
|
end
|
@@ -8,7 +8,7 @@ module Facts
|
|
8
8
|
|
9
9
|
def call_the_resolver
|
10
10
|
arr = []
|
11
|
-
interfaces = Facter::Resolvers::
|
11
|
+
interfaces = Facter::Resolvers::Linux::Networking.resolve(:interfaces)
|
12
12
|
interfaces&.each do |interface_name, info|
|
13
13
|
arr << Facter::ResolvedFact.new("netmask6_#{interface_name}", info[:netmask6], :legacy) if info[:netmask6]
|
14
14
|
end
|
@@ -8,7 +8,7 @@ module Facts
|
|
8
8
|
|
9
9
|
def call_the_resolver
|
10
10
|
arr = []
|
11
|
-
interfaces = Facter::Resolvers::
|
11
|
+
interfaces = Facter::Resolvers::Linux::Networking.resolve(:interfaces)
|
12
12
|
interfaces&.each do |interface_name, info|
|
13
13
|
arr << Facter::ResolvedFact.new("netmask_#{interface_name}", info[:netmask], :legacy) if info[:netmask]
|
14
14
|
end
|
@@ -8,7 +8,7 @@ module Facts
|
|
8
8
|
|
9
9
|
def call_the_resolver
|
10
10
|
arr = []
|
11
|
-
interfaces = Facter::Resolvers::
|
11
|
+
interfaces = Facter::Resolvers::Linux::Networking.resolve(:interfaces)
|
12
12
|
interfaces&.each do |interface_name, info|
|
13
13
|
arr << Facter::ResolvedFact.new("network6_#{interface_name}", info[:network6], :legacy) if info[:network6]
|
14
14
|
end
|
@@ -8,7 +8,7 @@ module Facts
|
|
8
8
|
|
9
9
|
def call_the_resolver
|
10
10
|
arr = []
|
11
|
-
interfaces = Facter::Resolvers::
|
11
|
+
interfaces = Facter::Resolvers::Linux::Networking.resolve(:interfaces)
|
12
12
|
interfaces&.each do |interface_name, info|
|
13
13
|
arr << Facter::ResolvedFact.new("network_#{interface_name}", info[:network], :legacy) if info[:network]
|
14
14
|
end
|
@@ -7,7 +7,7 @@ module Facts
|
|
7
7
|
FACT_NAME = 'networking.dhcp'
|
8
8
|
|
9
9
|
def call_the_resolver
|
10
|
-
fact_value = Facter::Resolvers::
|
10
|
+
fact_value = Facter::Resolvers::Linux::Networking.resolve(:dhcp)
|
11
11
|
|
12
12
|
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
13
13
|
end
|
@@ -8,7 +8,7 @@ module Facts
|
|
8
8
|
ALIASES = 'domain'
|
9
9
|
|
10
10
|
def call_the_resolver
|
11
|
-
fact_value = Facter::Resolvers::Hostname.resolve(:domain)
|
11
|
+
fact_value = Facter::Resolvers::Linux::Hostname.resolve(:domain)
|
12
12
|
|
13
13
|
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
14
14
|
end
|
@@ -8,7 +8,7 @@ module Facts
|
|
8
8
|
ALIASES = 'fqdn'
|
9
9
|
|
10
10
|
def call_the_resolver
|
11
|
-
fact_value = Facter::Resolvers::Hostname.resolve(:fqdn)
|
11
|
+
fact_value = Facter::Resolvers::Linux::Hostname.resolve(:fqdn)
|
12
12
|
|
13
13
|
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
14
14
|
end
|
@@ -8,7 +8,7 @@ module Facts
|
|
8
8
|
ALIASES = 'hostname'
|
9
9
|
|
10
10
|
def call_the_resolver
|
11
|
-
fact_value = Facter::Resolvers::Hostname.resolve(:hostname)
|
11
|
+
fact_value = Facter::Resolvers::Linux::Hostname.resolve(:hostname)
|
12
12
|
|
13
13
|
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
14
14
|
end
|
@@ -7,7 +7,7 @@ module Facts
|
|
7
7
|
FACT_NAME = 'networking.interfaces'
|
8
8
|
|
9
9
|
def call_the_resolver
|
10
|
-
fact_value = Facter::Resolvers::
|
10
|
+
fact_value = Facter::Resolvers::Linux::Networking.resolve(:interfaces)
|
11
11
|
|
12
12
|
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
13
13
|
end
|
@@ -8,7 +8,7 @@ module Facts
|
|
8
8
|
ALIASES = 'ipaddress'
|
9
9
|
|
10
10
|
def call_the_resolver
|
11
|
-
fact_value = Facter::Resolvers::
|
11
|
+
fact_value = Facter::Resolvers::Linux::Networking.resolve(:ip)
|
12
12
|
|
13
13
|
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
14
14
|
end
|
@@ -8,7 +8,7 @@ module Facts
|
|
8
8
|
ALIASES = 'ipaddress6'
|
9
9
|
|
10
10
|
def call_the_resolver
|
11
|
-
fact_value = Facter::Resolvers::
|
11
|
+
fact_value = Facter::Resolvers::Linux::Networking.resolve(:ip6)
|
12
12
|
|
13
13
|
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
14
14
|
end
|
@@ -8,7 +8,7 @@ module Facts
|
|
8
8
|
ALIASES = 'macaddress'
|
9
9
|
|
10
10
|
def call_the_resolver
|
11
|
-
fact_value = Facter::Resolvers::
|
11
|
+
fact_value = Facter::Resolvers::Linux::Networking.resolve(:mac)
|
12
12
|
|
13
13
|
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
14
14
|
end
|
@@ -8,7 +8,7 @@ module Facts
|
|
8
8
|
ALIASES = 'netmask'
|
9
9
|
|
10
10
|
def call_the_resolver
|
11
|
-
fact_value = Facter::Resolvers::
|
11
|
+
fact_value = Facter::Resolvers::Linux::Networking.resolve(:netmask)
|
12
12
|
|
13
13
|
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
14
14
|
end
|
@@ -8,7 +8,7 @@ module Facts
|
|
8
8
|
ALIASES = 'netmask6'
|
9
9
|
|
10
10
|
def call_the_resolver
|
11
|
-
fact_value = Facter::Resolvers::
|
11
|
+
fact_value = Facter::Resolvers::Linux::Networking.resolve(:netmask6)
|
12
12
|
|
13
13
|
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
14
14
|
end
|
@@ -8,7 +8,7 @@ module Facts
|
|
8
8
|
ALIASES = 'network'
|
9
9
|
|
10
10
|
def call_the_resolver
|
11
|
-
fact_value = Facter::Resolvers::
|
11
|
+
fact_value = Facter::Resolvers::Linux::Networking.resolve(:network)
|
12
12
|
|
13
13
|
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
14
14
|
end
|
@@ -8,7 +8,7 @@ module Facts
|
|
8
8
|
ALIASES = 'network6'
|
9
9
|
|
10
10
|
def call_the_resolver
|
11
|
-
fact_value = Facter::Resolvers::
|
11
|
+
fact_value = Facter::Resolvers::Linux::Networking.resolve(:network6)
|
12
12
|
|
13
13
|
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
14
14
|
end
|
@@ -7,7 +7,7 @@ module Facts
|
|
7
7
|
FACT_NAME = 'networking.primary'
|
8
8
|
|
9
9
|
def call_the_resolver
|
10
|
-
fact_value = Facter::Resolvers::
|
10
|
+
fact_value = Facter::Resolvers::Linux::Networking.resolve(:primary_interface)
|
11
11
|
|
12
12
|
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
13
13
|
end
|
@@ -8,7 +8,7 @@ module Facts
|
|
8
8
|
ALIASES = 'scope6'
|
9
9
|
|
10
10
|
def call_the_resolver
|
11
|
-
fact_value = Facter::Resolvers::
|
11
|
+
fact_value = Facter::Resolvers::Linux::Networking.resolve(:scope6)
|
12
12
|
|
13
13
|
[Facter::ResolvedFact.new(FACT_NAME, fact_value),
|
14
14
|
Facter::ResolvedFact.new('scope6', fact_value, :legacy)]
|
@@ -8,7 +8,7 @@ module Facts
|
|
8
8
|
|
9
9
|
def call_the_resolver
|
10
10
|
resolved_facts = []
|
11
|
-
interfaces = Facter::Resolvers::
|
11
|
+
interfaces = Facter::Resolvers::Linux::Networking.resolve(:interfaces)
|
12
12
|
|
13
13
|
interfaces&.each do |interface_name, info|
|
14
14
|
if info[:scope6]
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Rhel
|
5
|
+
class Lsbdistcodename
|
6
|
+
FACT_NAME = 'lsbdistcodename'
|
7
|
+
TYPE = :legacy
|
8
|
+
|
9
|
+
def call_the_resolver
|
10
|
+
fact_value = Facter::Resolvers::LsbRelease.resolve(:codename)
|
11
|
+
|
12
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value, :legacy)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Rhel
|
5
|
+
class Lsbdistdescription
|
6
|
+
FACT_NAME = 'lsbdistdescription'
|
7
|
+
TYPE = :legacy
|
8
|
+
|
9
|
+
def call_the_resolver
|
10
|
+
fact_value = Facter::Resolvers::LsbRelease.resolve(:description)
|
11
|
+
|
12
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value, :legacy)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Rhel
|
5
|
+
class Lsbdistid
|
6
|
+
FACT_NAME = 'lsbdistid'
|
7
|
+
TYPE = :legacy
|
8
|
+
|
9
|
+
def call_the_resolver
|
10
|
+
fact_value = Facter::Resolvers::LsbRelease.resolve(:distributor_id)
|
11
|
+
|
12
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value, :legacy)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -6,13 +6,11 @@ module Facts
|
|
6
6
|
module Distro
|
7
7
|
class Codename
|
8
8
|
FACT_NAME = 'os.distro.codename'
|
9
|
-
ALIASES = 'lsbdistcodename'
|
10
9
|
|
11
10
|
def call_the_resolver
|
12
|
-
fact_value = Facter::Resolvers::
|
11
|
+
fact_value = Facter::Resolvers::RedHatRelease.resolve(:codename)
|
13
12
|
|
14
|
-
|
15
|
-
Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
13
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
16
14
|
end
|
17
15
|
end
|
18
16
|
end
|
@@ -6,13 +6,11 @@ module Facts
|
|
6
6
|
module Distro
|
7
7
|
class Description
|
8
8
|
FACT_NAME = 'os.distro.description'
|
9
|
-
ALIASES = 'lsbdistdescription'
|
10
9
|
|
11
10
|
def call_the_resolver
|
12
|
-
fact_value = Facter::Resolvers::
|
11
|
+
fact_value = Facter::Resolvers::RedHatRelease.resolve(:description)
|
13
12
|
|
14
|
-
|
15
|
-
Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
13
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
16
14
|
end
|
17
15
|
end
|
18
16
|
end
|
@@ -6,13 +6,11 @@ module Facts
|
|
6
6
|
module Distro
|
7
7
|
class Id
|
8
8
|
FACT_NAME = 'os.distro.id'
|
9
|
-
ALIASES = 'lsbdistid'
|
10
9
|
|
11
10
|
def call_the_resolver
|
12
|
-
fact_value = Facter::Resolvers::
|
11
|
+
fact_value = Facter::Resolvers::RedHatRelease.resolve(:distributor_id)
|
13
12
|
|
14
|
-
|
15
|
-
Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
13
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
16
14
|
end
|
17
15
|
end
|
18
16
|
end
|
@@ -9,20 +9,21 @@ module Facts
|
|
9
9
|
ALIASES = %w[lsbdistrelease lsbmajdistrelease lsbminordistrelease].freeze
|
10
10
|
|
11
11
|
def call_the_resolver
|
12
|
-
|
13
|
-
return Facter::ResolvedFact.new(FACT_NAME, nil) unless fact_value
|
12
|
+
version = determine_release_version
|
14
13
|
|
15
|
-
|
16
|
-
release = {
|
17
|
-
'full' => fact_value,
|
18
|
-
'major' => versions[0],
|
19
|
-
'minor' => versions[1]
|
20
|
-
}
|
14
|
+
return Facter::ResolvedFact.new(FACT_NAME, nil) unless version
|
21
15
|
|
22
|
-
[Facter::ResolvedFact.new(FACT_NAME,
|
23
|
-
Facter::ResolvedFact.new(ALIASES[0],
|
24
|
-
Facter::ResolvedFact.new(ALIASES[1],
|
25
|
-
Facter::ResolvedFact.new(ALIASES[2],
|
16
|
+
[Facter::ResolvedFact.new(FACT_NAME, version),
|
17
|
+
Facter::ResolvedFact.new(ALIASES[0], version['full'], :legacy),
|
18
|
+
Facter::ResolvedFact.new(ALIASES[1], version['major'], :legacy),
|
19
|
+
Facter::ResolvedFact.new(ALIASES[2], version['minor'], :legacy)]
|
20
|
+
end
|
21
|
+
|
22
|
+
def determine_release_version
|
23
|
+
version = Facter::Resolvers::RedHatRelease.resolve(:version)
|
24
|
+
version ||= Facter::Resolvers::OsRelease.resolve(:version_id)
|
25
|
+
|
26
|
+
Facter::Util::Facts.release_hash_from_string(version)
|
26
27
|
end
|
27
28
|
end
|
28
29
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Sles
|
5
|
+
class Lsbdistcodename
|
6
|
+
FACT_NAME = 'lsbdistcodename'
|
7
|
+
TYPE = :legacy
|
8
|
+
|
9
|
+
def call_the_resolver
|
10
|
+
fact_value = Facter::Resolvers::LsbRelease.resolve(:codename)
|
11
|
+
|
12
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value, :legacy)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Sles
|
5
|
+
class Lsbdistdescription
|
6
|
+
FACT_NAME = 'lsbdistdescription'
|
7
|
+
TYPE = :legacy
|
8
|
+
|
9
|
+
def call_the_resolver
|
10
|
+
fact_value = Facter::Resolvers::LsbRelease.resolve(:description)
|
11
|
+
|
12
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value, :legacy)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Sles
|
5
|
+
class Lsbdistid
|
6
|
+
FACT_NAME = 'lsbdistid'
|
7
|
+
TYPE = :legacy
|
8
|
+
|
9
|
+
def call_the_resolver
|
10
|
+
fact_value = Facter::Resolvers::LsbRelease.resolve(:distributor_id)
|
11
|
+
|
12
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value, :legacy)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|