facter 4.6.1 → 4.7.1
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/custom_facts/core/aggregate.rb +5 -1
- data/lib/facter/custom_facts/util/confine.rb +4 -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/framework/logging/logger.rb +3 -2
- data/lib/facter/resolvers/aix/serialnumber.rb +1 -1
- data/lib/facter/resolvers/az.rb +1 -1
- data/lib/facter/resolvers/base_resolver.rb +3 -2
- data/lib/facter/resolvers/bsd/processors.rb +0 -1
- data/lib/facter/resolvers/disks.rb +0 -2
- data/lib/facter/resolvers/dmi.rb +0 -2
- data/lib/facter/resolvers/ec2.rb +1 -1
- data/lib/facter/resolvers/filesystems.rb +0 -2
- data/lib/facter/resolvers/fips_enabled.rb +0 -2
- data/lib/facter/resolvers/freebsd/processors.rb +0 -1
- data/lib/facter/resolvers/freebsd/swap_memory.rb +1 -1
- data/lib/facter/resolvers/gce.rb +1 -1
- data/lib/facter/resolvers/hostname.rb +5 -0
- data/lib/facter/resolvers/identity.rb +0 -2
- data/lib/facter/resolvers/macosx/mountpoints.rb +0 -2
- data/lib/facter/resolvers/memory.rb +0 -2
- data/lib/facter/resolvers/mountpoints.rb +0 -2
- 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/processors.rb +0 -2
- data/lib/facter/resolvers/solaris/mountpoints.rb +0 -2
- data/lib/facter/resolvers/solaris/networking.rb +0 -1
- data/lib/facter/resolvers/ssh.rb +0 -2
- data/lib/facter/resolvers/windows/dmi_bios.rb +0 -1
- data/lib/facter/resolvers/windows/dmi_computersystem.rb +0 -1
- data/lib/facter/resolvers/windows/hardware_architecture.rb +0 -1
- data/lib/facter/resolvers/windows/identity.rb +0 -1
- data/lib/facter/resolvers/windows/kernel.rb +0 -2
- data/lib/facter/resolvers/windows/memory.rb +0 -2
- data/lib/facter/resolvers/windows/networking.rb +0 -1
- data/lib/facter/resolvers/windows/ssh.rb +0 -2
- data/lib/facter/resolvers/windows/system32.rb +0 -2
- data/lib/facter/resolvers/windows/timezone.rb +0 -1
- data/lib/facter/resolvers/windows/uptime.rb +0 -2
- data/lib/facter/resolvers/windows/virtualization.rb +9 -4
- data/lib/facter/resolvers/windows/win_os_description.rb +0 -2
- data/lib/facter/resolvers/xen.rb +2 -0
- data/lib/facter/templates/man.erb +5 -2
- data/lib/facter/util/api_debugger.rb +2 -2
- data/lib/facter/util/facts/posix/virtual_detector.rb +7 -1
- data/lib/facter/util/resolvers/http.rb +31 -20
- data/lib/facter/version.rb +1 -1
- metadata +99 -13
@@ -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
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
module Networking
|
6
|
+
class Ip6
|
7
|
+
FACT_NAME = 'networking.ip6'
|
8
|
+
ALIASES = 'ipaddress6'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Networking.resolve(:ip6)
|
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 Mac
|
7
|
+
FACT_NAME = 'networking.mac'
|
8
|
+
ALIASES = 'macaddress'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Networking.resolve(:mac)
|
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 Mtu
|
7
|
+
FACT_NAME = 'networking.mtu'
|
8
|
+
|
9
|
+
def call_the_resolver
|
10
|
+
fact_value = Facter::Resolvers::Networking.resolve(:mtu)
|
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 Netmask
|
7
|
+
FACT_NAME = 'networking.netmask'
|
8
|
+
ALIASES = 'netmask'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Networking.resolve(:netmask)
|
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 Netmask6
|
7
|
+
FACT_NAME = 'networking.netmask6'
|
8
|
+
ALIASES = 'netmask6'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Networking.resolve(:netmask6)
|
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 Network
|
7
|
+
FACT_NAME = 'networking.network'
|
8
|
+
ALIASES = 'network'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Networking.resolve(:network)
|
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 Network6
|
7
|
+
FACT_NAME = 'networking.network6'
|
8
|
+
ALIASES = 'network6'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Networking.resolve(:network6)
|
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 Primary
|
7
|
+
FACT_NAME = 'networking.primary'
|
8
|
+
|
9
|
+
def call_the_resolver
|
10
|
+
fact_value = Facter::Resolvers::Networking.resolve(:primary_interface)
|
11
|
+
|
12
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
module Networking
|
6
|
+
class Scope6
|
7
|
+
FACT_NAME = 'networking.scope6'
|
8
|
+
|
9
|
+
def call_the_resolver
|
10
|
+
fact_value = Facter::Resolvers::Networking.resolve(:scope6)
|
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 Os
|
6
|
+
class Architecture
|
7
|
+
FACT_NAME = 'os.architecture'
|
8
|
+
ALIASES = 'architecture'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Uname.resolve(:machine)
|
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 Os
|
6
|
+
class Hardware
|
7
|
+
FACT_NAME = 'os.hardware'
|
8
|
+
ALIASES = 'hardwaremodel'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Uname.resolve(:machine)
|
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 Os
|
6
|
+
class Name
|
7
|
+
FACT_NAME = 'os.name'
|
8
|
+
ALIASES = 'operatingsystem'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Uname.resolve(:kernelname)
|
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,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
module Os
|
6
|
+
class Release
|
7
|
+
FACT_NAME = 'os.release'
|
8
|
+
ALIASES = %w[operatingsystemmajrelease operatingsystemrelease].freeze
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
# From Freebsd
|
12
|
+
# Facter::ResolvedFact.new(ALIASES.last, installed_userland, :legacy)]
|
13
|
+
|
14
|
+
version = Facter::Resolvers::Uname.resolve(:kernelrelease)
|
15
|
+
major, minor = version.split('.')
|
16
|
+
[Facter::ResolvedFact.new(FACT_NAME, full: version, major: major, minor: minor),
|
17
|
+
Facter::ResolvedFact.new(ALIASES.first, major, :legacy),
|
18
|
+
Facter::ResolvedFact.new(ALIASES.last, version, :legacy)]
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
class Path
|
6
|
+
FACT_NAME = 'path'
|
7
|
+
|
8
|
+
def call_the_resolver
|
9
|
+
fact_value = Facter::Resolvers::Path.resolve(:path)
|
10
|
+
|
11
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
module Processors
|
6
|
+
class Isa
|
7
|
+
FACT_NAME = 'processors.isa'
|
8
|
+
ALIASES = 'hardwareisa'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Uname.resolve(:processor)
|
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,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
module Ruby
|
6
|
+
class Platform
|
7
|
+
FACT_NAME = 'ruby.platform'
|
8
|
+
ALIASES = 'rubyplatform'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Ruby.resolve(:platform)
|
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 Ruby
|
6
|
+
class Sitedir
|
7
|
+
FACT_NAME = 'ruby.sitedir'
|
8
|
+
ALIASES = 'rubysitedir'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Ruby.resolve(:sitedir)
|
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 Ruby
|
6
|
+
class Version
|
7
|
+
FACT_NAME = 'ruby.version'
|
8
|
+
ALIASES = 'rubyversion'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Ruby.resolve(:version)
|
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,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
class Ssh
|
6
|
+
FACT_NAME = 'ssh'
|
7
|
+
|
8
|
+
def call_the_resolver
|
9
|
+
result = Facter::Resolvers::Ssh.resolve(:ssh)
|
10
|
+
ssh_facts = {}
|
11
|
+
result.each { |ssh| ssh_facts.merge!(create_ssh_fact(ssh)) }
|
12
|
+
Facter::ResolvedFact.new(FACT_NAME, ssh_facts)
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def create_ssh_fact(ssh)
|
18
|
+
{ ssh.name.to_sym =>
|
19
|
+
{ fingerprints: { sha1: ssh.fingerprint.sha1,
|
20
|
+
sha256: ssh.fingerprint.sha256 },
|
21
|
+
key: ssh.key,
|
22
|
+
type: ssh.type } }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
class Sshalgorithmkey
|
6
|
+
FACT_NAME = 'ssh.*key'
|
7
|
+
TYPE = :legacy
|
8
|
+
|
9
|
+
def call_the_resolver
|
10
|
+
facts = []
|
11
|
+
result = Facter::Resolvers::Ssh.resolve(:ssh)
|
12
|
+
result.each { |ssh| facts << Facter::ResolvedFact.new("ssh#{ssh.name.to_sym}key", ssh.key, :legacy) }
|
13
|
+
facts
|
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 SshfpAlgorithm
|
6
|
+
FACT_NAME = 'sshfp_.*'
|
7
|
+
TYPE = :legacy
|
8
|
+
|
9
|
+
def call_the_resolver
|
10
|
+
facts = []
|
11
|
+
result = Facter::Resolvers::Ssh.resolve(:ssh)
|
12
|
+
result.each do |ssh|
|
13
|
+
facts << Facter::ResolvedFact.new("sshfp_#{ssh.name.to_sym}",
|
14
|
+
"#{ssh.fingerprint.sha1}\n#{ssh.fingerprint.sha256}", :legacy)
|
15
|
+
end
|
16
|
+
facts
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
module SystemUptime
|
6
|
+
class Days
|
7
|
+
FACT_NAME = 'system_uptime.days'
|
8
|
+
ALIASES = 'uptime_days'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Uptime.resolve(:days)
|
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 SystemUptime
|
6
|
+
class Hours
|
7
|
+
FACT_NAME = 'system_uptime.hours'
|
8
|
+
ALIASES = 'uptime_hours'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Uptime.resolve(:hours)
|
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 SystemUptime
|
6
|
+
class Seconds
|
7
|
+
FACT_NAME = 'system_uptime.seconds'
|
8
|
+
ALIASES = 'uptime_seconds'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Uptime.resolve(:seconds)
|
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 SystemUptime
|
6
|
+
class Uptime
|
7
|
+
FACT_NAME = 'system_uptime.uptime'
|
8
|
+
ALIASES = 'uptime'
|
9
|
+
|
10
|
+
def call_the_resolver
|
11
|
+
fact_value = Facter::Resolvers::Uptime.resolve(:uptime)
|
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,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
class Timezone
|
6
|
+
FACT_NAME = 'timezone'
|
7
|
+
|
8
|
+
def call_the_resolver
|
9
|
+
fact_value = Facter::Resolvers::Timezone.resolve(:timezone)
|
10
|
+
|
11
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Facts
|
4
|
+
module Openbsd
|
5
|
+
class Virtual
|
6
|
+
FACT_NAME = 'virtual'
|
7
|
+
|
8
|
+
def call_the_resolver
|
9
|
+
fact_value = Facter::Util::Facts::Posix::VirtualDetector.platform
|
10
|
+
|
11
|
+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -54,7 +54,7 @@ module Facts
|
|
54
54
|
def create_resolved_facts_list(fact_value)
|
55
55
|
resolved_facts = [Facter::ResolvedFact.new(FACT_NAME, fact_value)]
|
56
56
|
ALIASES.each do |fact_alias|
|
57
|
-
key = fact_alias.split('_')[1
|
57
|
+
key = fact_alias.split('_')[1..-1].map!(&:to_sym)
|
58
58
|
resolved_facts << Facter::ResolvedFact.new(fact_alias, fact_value.dig(*key), :legacy)
|
59
59
|
end
|
60
60
|
|
@@ -10,11 +10,14 @@ module Facts
|
|
10
10
|
virtual = Facter::Resolvers::Windows::Virtualization.resolve(:virtual)
|
11
11
|
provider = case virtual
|
12
12
|
when 'hyperv'
|
13
|
-
|
13
|
+
metadata = Facter::Resolvers::Az.resolve(:metadata)
|
14
|
+
'azure' unless metadata.nil? || metadata.empty?
|
14
15
|
when 'kvm', 'xen'
|
15
|
-
|
16
|
+
metadata = Facter::Resolvers::Ec2.resolve(:metadata)
|
17
|
+
'aws' unless metadata.nil? || metadata.empty?
|
16
18
|
when 'gce'
|
17
|
-
|
19
|
+
metadata = Facter::Resolvers::Gce.resolve(:metadata)
|
20
|
+
'gce' unless metadata.nil? || metadata.empty?
|
18
21
|
end
|
19
22
|
|
20
23
|
Facter::ResolvedFact.new(FACT_NAME, provider)
|
@@ -113,7 +113,7 @@ module Facter
|
|
113
113
|
negate_options = %w[block cache custom_facts external_facts]
|
114
114
|
|
115
115
|
template = File.join(File.dirname(__FILE__), '..', '..', 'templates', 'man.erb')
|
116
|
-
erb = ERB.new(File.read(template),
|
116
|
+
erb = ERB.new(File.read(template), nil, '-')
|
117
117
|
erb.filename = template
|
118
118
|
puts erb.result(binding)
|
119
119
|
end
|
@@ -148,7 +148,7 @@ module Facter
|
|
148
148
|
options = @options.map { |(k, v)| [k.to_sym, v] }.to_h
|
149
149
|
Facter::Options.init_from_cli(options)
|
150
150
|
|
151
|
-
block_groups = Facter::FactGroups.new.groups.to_yaml.lines[1
|
151
|
+
block_groups = Facter::FactGroups.new.groups.to_yaml.lines[1..-1].join
|
152
152
|
block_groups.gsub!(/:\s*\n/, "\n")
|
153
153
|
|
154
154
|
puts block_groups
|
@@ -160,7 +160,7 @@ module Facter
|
|
160
160
|
options = @options.map { |(k, v)| [k.to_sym, v] }.to_h
|
161
161
|
Facter::Options.init_from_cli(options)
|
162
162
|
|
163
|
-
cache_groups = Facter::FactGroups.new.groups.to_yaml.lines[1
|
163
|
+
cache_groups = Facter::FactGroups.new.groups.to_yaml.lines[1..-1].join
|
164
164
|
cache_groups.gsub!(/:\s*\n/, "\n")
|
165
165
|
|
166
166
|
puts cache_groups
|