facter 4.6.0 → 4.7.0
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.rb +6 -1
- data/lib/facter/config.rb +3 -2
- data/lib/facter/facts/linux/cloud/provider.rb +6 -3
- data/lib/facter/facts/openbsd/augeas/version.rb +19 -0
- data/lib/facter/facts/openbsd/dmi/bios/vendor.rb +19 -0
- data/lib/facter/facts/openbsd/dmi/bios/version.rb +19 -0
- data/lib/facter/facts/openbsd/dmi/manufacturer.rb +17 -0
- data/lib/facter/facts/openbsd/dmi/product/name.rb +19 -0
- data/lib/facter/facts/openbsd/dmi/product/serial_number.rb +19 -0
- data/lib/facter/facts/openbsd/dmi/product/uuid.rb +19 -0
- data/lib/facter/facts/openbsd/ec2_metadata.rb +23 -0
- data/lib/facter/facts/openbsd/ec2_userdata.rb +23 -0
- data/lib/facter/facts/openbsd/facterversion.rb +14 -0
- data/lib/facter/facts/openbsd/identity/gid.rb +16 -0
- data/lib/facter/facts/openbsd/identity/group.rb +18 -0
- data/lib/facter/facts/openbsd/identity/privileged.rb +16 -0
- data/lib/facter/facts/openbsd/identity/uid.rb +16 -0
- data/lib/facter/facts/openbsd/identity/user.rb +17 -0
- data/lib/facter/facts/openbsd/ipaddress6_interfaces.rb +20 -0
- data/lib/facter/facts/openbsd/ipaddress_interfaces.rb +20 -0
- data/lib/facter/facts/openbsd/is_virtual.rb +21 -0
- data/lib/facter/facts/openbsd/kernel.rb +14 -0
- data/lib/facter/facts/openbsd/kernelrelease.rb +14 -0
- data/lib/facter/facts/openbsd/mountpoints.rb +21 -0
- data/lib/facter/facts/openbsd/netmask6_interfaces.rb +20 -0
- data/lib/facter/facts/openbsd/netmask_interfaces.rb +20 -0
- data/lib/facter/facts/openbsd/network6_interfaces.rb +20 -0
- data/lib/facter/facts/openbsd/network_interfaces.rb +20 -0
- data/lib/facter/facts/openbsd/networking/dhcp.rb +17 -0
- data/lib/facter/facts/openbsd/networking/domain.rb +18 -0
- data/lib/facter/facts/openbsd/networking/fqdn.rb +18 -0
- data/lib/facter/facts/openbsd/networking/hostname.rb +18 -0
- data/lib/facter/facts/openbsd/networking/interfaces.rb +17 -0
- data/lib/facter/facts/openbsd/networking/ip.rb +18 -0
- data/lib/facter/facts/openbsd/networking/ip6.rb +18 -0
- data/lib/facter/facts/openbsd/networking/mac.rb +18 -0
- data/lib/facter/facts/openbsd/networking/mtu.rb +17 -0
- data/lib/facter/facts/openbsd/networking/netmask.rb +18 -0
- data/lib/facter/facts/openbsd/networking/netmask6.rb +18 -0
- data/lib/facter/facts/openbsd/networking/network.rb +18 -0
- data/lib/facter/facts/openbsd/networking/network6.rb +18 -0
- data/lib/facter/facts/openbsd/networking/primary.rb +17 -0
- data/lib/facter/facts/openbsd/networking/scope6.rb +17 -0
- data/lib/facter/facts/openbsd/os/architecture.rb +18 -0
- data/lib/facter/facts/openbsd/os/hardware.rb +18 -0
- data/lib/facter/facts/openbsd/os/name.rb +18 -0
- data/lib/facter/facts/openbsd/os/release.rb +23 -0
- data/lib/facter/facts/openbsd/path.rb +15 -0
- data/lib/facter/facts/openbsd/processors/isa.rb +17 -0
- data/lib/facter/facts/openbsd/ruby/platform.rb +18 -0
- data/lib/facter/facts/openbsd/ruby/sitedir.rb +18 -0
- data/lib/facter/facts/openbsd/ruby/version.rb +18 -0
- data/lib/facter/facts/openbsd/ssh.rb +26 -0
- data/lib/facter/facts/openbsd/sshalgorithmkey.rb +17 -0
- data/lib/facter/facts/openbsd/sshfp_algorithm.rb +20 -0
- data/lib/facter/facts/openbsd/system_uptime/days.rb +18 -0
- data/lib/facter/facts/openbsd/system_uptime/hours.rb +18 -0
- data/lib/facter/facts/openbsd/system_uptime/seconds.rb +18 -0
- data/lib/facter/facts/openbsd/system_uptime/uptime.rb +18 -0
- data/lib/facter/facts/openbsd/timezone.rb +15 -0
- data/lib/facter/facts/openbsd/virtual.rb +15 -0
- data/lib/facter/facts/solaris/ldom.rb +1 -1
- data/lib/facter/facts/windows/cloud/provider.rb +6 -3
- data/lib/facter/framework/cli/cli.rb +3 -3
- data/lib/facter/framework/core/file_loader.rb +59 -0
- data/lib/facter/framework/detector/os_detector.rb +2 -0
- data/lib/facter/resolvers/aix/serialnumber.rb +1 -1
- data/lib/facter/resolvers/freebsd/swap_memory.rb +1 -1
- data/lib/facter/resolvers/networking.rb +1 -1
- data/lib/facter/resolvers/openbsd/dhcp.rb +21 -0
- data/lib/facter/resolvers/openbsd/dmi.rb +41 -0
- data/lib/facter/resolvers/openbsd/mountpoints.rb +72 -0
- data/lib/facter/resolvers/openbsd/virtual.rb +45 -0
- data/lib/facter/resolvers/partitions.rb +2 -2
- data/lib/facter/resolvers/windows/product_release.rb +1 -1
- data/lib/facter/util/api_debugger.rb +2 -2
- data/lib/facter/util/facts/posix/virtual_detector.rb +7 -1
- data/lib/facter/version.rb +1 -1
- metadata +73 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 101e10975c853baea839c1f0b5afc9d409f85df720a581d2987cf61cb50101af
|
4
|
+
data.tar.gz: 828a50d3cf221d2bec58e90400684d25c9adff0b3fe93c39535e1136dc628e34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d367e6d5b5b248767d77464e02f99951219bdd99108990fb2b4af0724c769f9dba18073e382ba244b81413d486547a284ae949779f31a2a0a5299d1b7a448cf
|
7
|
+
data.tar.gz: af8d6958c1cc05eb883fc5479c863c6613fb49737ea38c251cb7facd3c05ab6c57990334f419604b3102a05736182756daed55492c5644c849c3f71e1d7acd76
|
data/lib/docs/generate.rb
CHANGED
@@ -17,7 +17,12 @@ def format_facts(fact_hash)
|
|
17
17
|
scope = OpenStruct.new({
|
18
18
|
facts: fact_hash
|
19
19
|
})
|
20
|
-
|
20
|
+
|
21
|
+
erb = if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+
|
22
|
+
ERB.new(File.read(PATH_TO_TEMPLATE), trim_mode: '-')
|
23
|
+
else
|
24
|
+
ERB.new(File.read(PATH_TO_TEMPLATE), nil, '-')
|
25
|
+
end
|
21
26
|
erb.result(scope.instance_eval { binding })
|
22
27
|
end
|
23
28
|
|
data/lib/facter/config.rb
CHANGED
@@ -9,11 +9,14 @@ module Facts
|
|
9
9
|
def call_the_resolver
|
10
10
|
provider = case Facter::Util::Facts::Posix::VirtualDetector.platform
|
11
11
|
when 'hyperv'
|
12
|
-
|
12
|
+
metadata = Facter::Resolvers::Az.resolve(:metadata)
|
13
|
+
'azure' unless metadata.nil? || metadata.empty?
|
13
14
|
when 'kvm', 'xen'
|
14
|
-
|
15
|
+
metadata = Facter::Resolvers::Ec2.resolve(:metadata)
|
16
|
+
'aws' unless metadata.nil? || metadata.empty?
|
15
17
|
when 'gce'
|
16
|
-
|
18
|
+
metadata = Facter::Resolvers::Gce.resolve(:metadata)
|
19
|
+
'gce' unless metadata.nil? || metadata.empty?
|
17
20
|
end
|
18
21
|
|
19
22
|
Facter::ResolvedFact.new(FACT_NAME, provider)
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
module Augeas
|
6
|
+
class Version
|
7
|
+
FACT_NAME = 'augeas.version'
|
8
|
+
ALIASES = 'augeasversion'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Augeas.resolve(:augeas_version)
|
12
|
+
|
13
|
+
[Facter::ResolvedFact.new(FACT_NAME, fact_value),
|
14
|
+
Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
module Dmi
|
6
|
+
module Bios
|
7
|
+
class Vendor
|
8
|
+
FACT_NAME = 'dmi.bios.vendor'
|
9
|
+
ALIASES = 'bios_vendor'
|
10
|
+
|
11
|
+
def call_the_resolver
|
12
|
+
fact_value = Facter::Resolvers::Openbsd::DmiBios.resolve(:bios_vendor)
|
13
|
+
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
module Dmi
|
6
|
+
module Bios
|
7
|
+
class Version
|
8
|
+
FACT_NAME = 'dmi.bios.version'
|
9
|
+
ALIASES = 'bios_version'
|
10
|
+
|
11
|
+
def call_the_resolver
|
12
|
+
fact_value = Facter::Resolvers::Openbsd::DmiBios.resolve(:bios_version)
|
13
|
+
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
module Dmi
|
6
|
+
class Manufacturer
|
7
|
+
FACT_NAME = 'dmi.manufacturer'
|
8
|
+
ALIASES = 'manufacturer'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Openbsd::DmiBios.resolve(:sys_vendor)
|
12
|
+
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
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 = Facter::Resolvers::Openbsd::DmiBios.resolve(:product_name)
|
13
|
+
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
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 = Facter::Resolvers::Openbsd::DmiBios.resolve(:product_serial)
|
13
|
+
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
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 = Facter::Resolvers::Openbsd::DmiBios.resolve(:product_uuid)
|
13
|
+
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
class Ec2Metadata
|
6
|
+
FACT_NAME = 'ec2_metadata'
|
7
|
+
|
8
|
+
def call_the_resolver
|
9
|
+
return Facter::ResolvedFact.new(FACT_NAME, nil) unless aws_hypervisors?
|
10
|
+
|
11
|
+
fact_value = Facter::Resolvers::Ec2.resolve(:metadata)
|
12
|
+
|
13
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value&.empty? ? nil : fact_value)
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def aws_hypervisors?
|
19
|
+
Facter::Util::Facts::Posix::VirtualDetector.platform =~ /kvm|xen|aws/
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
class Ec2Userdata
|
6
|
+
FACT_NAME = 'ec2_userdata'
|
7
|
+
|
8
|
+
def call_the_resolver
|
9
|
+
return Facter::ResolvedFact.new(FACT_NAME, nil) unless aws_hypervisors?
|
10
|
+
|
11
|
+
fact_value = Facter::Resolvers::Ec2.resolve(:userdata)
|
12
|
+
|
13
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value&.empty? ? nil : fact_value)
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def aws_hypervisors?
|
19
|
+
Facter::Util::Facts::Posix::VirtualDetector.platform =~ /kvm|xen|aws/
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
class Facterversion
|
6
|
+
FACT_NAME = 'facterversion'
|
7
|
+
|
8
|
+
def call_the_resolver
|
9
|
+
fact_value = Facter::Resolvers::Facterversion.resolve(:facterversion)
|
10
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
module Identity
|
6
|
+
class Gid
|
7
|
+
FACT_NAME = 'identity.gid'
|
8
|
+
|
9
|
+
def call_the_resolver
|
10
|
+
fact_value = Facter::Resolvers::PosxIdentity.resolve(:gid)
|
11
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
module Identity
|
6
|
+
class Group
|
7
|
+
FACT_NAME = 'identity.group'
|
8
|
+
ALIASES = 'gid'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::PosxIdentity.resolve(:group)
|
12
|
+
|
13
|
+
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
module Identity
|
6
|
+
class Privileged
|
7
|
+
FACT_NAME = 'identity.privileged'
|
8
|
+
|
9
|
+
def call_the_resolver
|
10
|
+
fact_value = Facter::Resolvers::PosxIdentity.resolve(:privileged)
|
11
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
module Identity
|
6
|
+
class Uid
|
7
|
+
FACT_NAME = 'identity.uid'
|
8
|
+
|
9
|
+
def call_the_resolver
|
10
|
+
fact_value = Facter::Resolvers::PosxIdentity.resolve(:uid)
|
11
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
module Identity
|
6
|
+
class User
|
7
|
+
FACT_NAME = 'identity.user'
|
8
|
+
ALIASES = 'id'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::PosxIdentity.resolve(:user)
|
12
|
+
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
class Ipaddress6Interfaces
|
6
|
+
FACT_NAME = 'ipaddress6_.*'
|
7
|
+
TYPE = :legacy
|
8
|
+
|
9
|
+
def call_the_resolver
|
10
|
+
arr = []
|
11
|
+
interfaces = Facter::Resolvers::Networking.resolve(:interfaces)
|
12
|
+
interfaces&.each do |interface_name, info|
|
13
|
+
arr << Facter::ResolvedFact.new("ipaddress6_#{interface_name}", info[:ip6], :legacy) if info[:ip6]
|
14
|
+
end
|
15
|
+
|
16
|
+
arr
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
class IpaddressInterfaces
|
6
|
+
FACT_NAME = 'ipaddress_.*'
|
7
|
+
TYPE = :legacy
|
8
|
+
|
9
|
+
def call_the_resolver
|
10
|
+
arr = []
|
11
|
+
interfaces = Facter::Resolvers::Networking.resolve(:interfaces)
|
12
|
+
interfaces&.each do |interface_name, info|
|
13
|
+
arr << Facter::ResolvedFact.new("ipaddress_#{interface_name}", info[:ip], :legacy) if info[:ip]
|
14
|
+
end
|
15
|
+
|
16
|
+
arr
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
class IsVirtual
|
6
|
+
FACT_NAME = 'is_virtual'
|
7
|
+
|
8
|
+
def call_the_resolver
|
9
|
+
fact_value = Facter::Util::Facts::Posix::VirtualDetector.platform
|
10
|
+
|
11
|
+
Facter::ResolvedFact.new(FACT_NAME, check_if_virtual(fact_value))
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def check_if_virtual(found_vm)
|
17
|
+
Facter::Util::Facts::PHYSICAL_HYPERVISORS.count(found_vm).zero?
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
class Kernel
|
6
|
+
FACT_NAME = 'kernel'
|
7
|
+
|
8
|
+
def call_the_resolver
|
9
|
+
fact_value = Facter::Resolvers::Uname.resolve(:kernelname)
|
10
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
class Kernelrelease
|
6
|
+
FACT_NAME = 'kernelrelease'
|
7
|
+
|
8
|
+
def call_the_resolver
|
9
|
+
fact_value = Facter::Resolvers::Uname.resolve(:kernelrelease)
|
10
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
class Mountpoints
|
6
|
+
FACT_NAME = 'mountpoints'
|
7
|
+
|
8
|
+
def call_the_resolver
|
9
|
+
mountpoints = Facter::Resolvers::Openbsd::Mountpoints.resolve(FACT_NAME.to_sym)
|
10
|
+
return Facter::ResolvedFact.new(FACT_NAME, nil) unless mountpoints
|
11
|
+
|
12
|
+
fact = {}
|
13
|
+
mountpoints.each do |path, mnt|
|
14
|
+
fact[path.to_sym] = mnt.reject { |k| k == :path }
|
15
|
+
end
|
16
|
+
|
17
|
+
Facter::ResolvedFact.new(FACT_NAME, fact)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
class Netmask6Interfaces
|
6
|
+
FACT_NAME = 'netmask6_.*'
|
7
|
+
TYPE = :legacy
|
8
|
+
|
9
|
+
def call_the_resolver
|
10
|
+
arr = []
|
11
|
+
interfaces = Facter::Resolvers::Networking.resolve(:interfaces)
|
12
|
+
interfaces&.each do |interface_name, info|
|
13
|
+
arr << Facter::ResolvedFact.new("netmask6_#{interface_name}", info[:netmask6], :legacy) if info[:netmask6]
|
14
|
+
end
|
15
|
+
|
16
|
+
arr
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
class NetmaskInterfaces
|
6
|
+
FACT_NAME = 'netmask_.*'
|
7
|
+
TYPE = :legacy
|
8
|
+
|
9
|
+
def call_the_resolver
|
10
|
+
arr = []
|
11
|
+
interfaces = Facter::Resolvers::Networking.resolve(:interfaces)
|
12
|
+
interfaces&.each do |interface_name, info|
|
13
|
+
arr << Facter::ResolvedFact.new("netmask_#{interface_name}", info[:netmask], :legacy) if info[:netmask]
|
14
|
+
end
|
15
|
+
|
16
|
+
arr
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
class Network6Interfaces
|
6
|
+
FACT_NAME = 'network6_.*'
|
7
|
+
TYPE = :legacy
|
8
|
+
|
9
|
+
def call_the_resolver
|
10
|
+
arr = []
|
11
|
+
interfaces = Facter::Resolvers::Networking.resolve(:interfaces)
|
12
|
+
interfaces&.each do |interface_name, info|
|
13
|
+
arr << Facter::ResolvedFact.new("network6_#{interface_name}", info[:network6], :legacy) if info[:network6]
|
14
|
+
end
|
15
|
+
|
16
|
+
arr
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
class NetworkInterfaces
|
6
|
+
FACT_NAME = 'network_.*'
|
7
|
+
TYPE = :legacy
|
8
|
+
|
9
|
+
def call_the_resolver
|
10
|
+
arr = []
|
11
|
+
interfaces = Facter::Resolvers::Networking.resolve(:interfaces)
|
12
|
+
interfaces&.each do |interface_name, info|
|
13
|
+
arr << Facter::ResolvedFact.new("network_#{interface_name}", info[:network], :legacy) if info[:network]
|
14
|
+
end
|
15
|
+
|
16
|
+
arr
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
module Networking
|
6
|
+
class Dhcp
|
7
|
+
FACT_NAME = 'networking.dhcp'
|
8
|
+
|
9
|
+
def call_the_resolver
|
10
|
+
fact_value = Facter::Resolvers::Openbsd::Dhcp.resolve(:dhcp)
|
11
|
+
|
12
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
module Networking
|
6
|
+
class Domain
|
7
|
+
FACT_NAME = 'networking.domain'
|
8
|
+
ALIASES = 'domain'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Hostname.resolve(:domain)
|
12
|
+
|
13
|
+
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
module Networking
|
6
|
+
class Fqdn
|
7
|
+
FACT_NAME = 'networking.fqdn'
|
8
|
+
ALIASES = 'fqdn'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Hostname.resolve(:fqdn)
|
12
|
+
|
13
|
+
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
module Networking
|
6
|
+
class Hostname
|
7
|
+
FACT_NAME = 'networking.hostname'
|
8
|
+
ALIASES = 'hostname'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Hostname.resolve(:hostname)
|
12
|
+
|
13
|
+
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
module Networking
|
6
|
+
class Interfaces
|
7
|
+
FACT_NAME = 'networking.interfaces'
|
8
|
+
|
9
|
+
def call_the_resolver
|
10
|
+
fact_value = Facter::Resolvers::Networking.resolve(:interfaces)
|
11
|
+
|
12
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
module Networking
|
6
|
+
class Ip
|
7
|
+
FACT_NAME = 'networking.ip'
|
8
|
+
ALIASES = 'ipaddress'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Networking.resolve(:ip)
|
12
|
+
|
13
|
+
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|