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
@@ -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
|
@@ -650,6 +650,65 @@ os_hierarchy.each do |os|
|
|
650
650
|
require_relative '../../facts/ol/os/distro/description'
|
651
651
|
require_relative '../../facts/ol/os/distro/id'
|
652
652
|
|
653
|
+
when 'openbsd'
|
654
|
+
require_relative '../../facts/openbsd/augeas/version'
|
655
|
+
require_relative '../../facts/openbsd/ec2_metadata'
|
656
|
+
require_relative '../../facts/openbsd/ec2_userdata'
|
657
|
+
require_relative '../../facts/openbsd/facterversion'
|
658
|
+
require_relative '../../facts/openbsd/is_virtual'
|
659
|
+
require_relative '../../facts/openbsd/kernel'
|
660
|
+
require_relative '../../facts/openbsd/kernelrelease'
|
661
|
+
require_relative '../../facts/openbsd/mountpoints'
|
662
|
+
require_relative '../../facts/openbsd/path'
|
663
|
+
require_relative '../../facts/openbsd/ssh'
|
664
|
+
require_relative '../../facts/openbsd/sshalgorithmkey'
|
665
|
+
require_relative '../../facts/openbsd/sshfp_algorithm'
|
666
|
+
require_relative '../../facts/openbsd/timezone'
|
667
|
+
require_relative '../../facts/openbsd/virtual'
|
668
|
+
require_relative '../../facts/openbsd/dmi/bios/vendor'
|
669
|
+
require_relative '../../facts/openbsd/dmi/bios/version'
|
670
|
+
require_relative '../../facts/openbsd/dmi/manufacturer'
|
671
|
+
require_relative '../../facts/openbsd/dmi/product/name'
|
672
|
+
require_relative '../../facts/openbsd/dmi/product/serial_number'
|
673
|
+
require_relative '../../facts/openbsd/dmi/product/uuid'
|
674
|
+
require_relative '../../facts/openbsd/identity/group'
|
675
|
+
require_relative '../../facts/openbsd/identity/gid'
|
676
|
+
require_relative '../../facts/openbsd/identity/privileged'
|
677
|
+
require_relative '../../facts/openbsd/identity/uid'
|
678
|
+
require_relative '../../facts/openbsd/identity/user'
|
679
|
+
require_relative '../../facts/openbsd/networking/dhcp'
|
680
|
+
require_relative '../../facts/openbsd/networking/domain'
|
681
|
+
require_relative '../../facts/openbsd/networking/fqdn'
|
682
|
+
require_relative '../../facts/openbsd/networking/hostname'
|
683
|
+
require_relative '../../facts/openbsd/networking/interfaces'
|
684
|
+
require_relative '../../facts/openbsd/networking/ip'
|
685
|
+
require_relative '../../facts/openbsd/networking/ip6'
|
686
|
+
require_relative '../../facts/openbsd/networking/mac'
|
687
|
+
require_relative '../../facts/openbsd/networking/mtu'
|
688
|
+
require_relative '../../facts/openbsd/networking/netmask'
|
689
|
+
require_relative '../../facts/openbsd/networking/netmask6'
|
690
|
+
require_relative '../../facts/openbsd/networking/network'
|
691
|
+
require_relative '../../facts/openbsd/networking/network6'
|
692
|
+
require_relative '../../facts/openbsd/networking/primary'
|
693
|
+
require_relative '../../facts/openbsd/networking/scope6'
|
694
|
+
require_relative '../../facts/openbsd/os/architecture'
|
695
|
+
require_relative '../../facts/openbsd/os/hardware'
|
696
|
+
require_relative '../../facts/openbsd/os/name'
|
697
|
+
require_relative '../../facts/openbsd/os/release'
|
698
|
+
require_relative '../../facts/openbsd/processors/isa'
|
699
|
+
require_relative '../../facts/openbsd/ruby/platform'
|
700
|
+
require_relative '../../facts/openbsd/ruby/sitedir'
|
701
|
+
require_relative '../../facts/openbsd/ruby/version'
|
702
|
+
require_relative '../../facts/openbsd/system_uptime/days'
|
703
|
+
require_relative '../../facts/openbsd/system_uptime/hours'
|
704
|
+
require_relative '../../facts/openbsd/system_uptime/seconds'
|
705
|
+
require_relative '../../facts/openbsd/system_uptime/uptime'
|
706
|
+
|
707
|
+
require_relative '../../resolvers/openbsd/dhcp'
|
708
|
+
require_relative '../../resolvers/openbsd/dmi'
|
709
|
+
require_relative '../../resolvers/openbsd/mountpoints'
|
710
|
+
require_relative '../../resolvers/openbsd/virtual'
|
711
|
+
|
653
712
|
when 'openwrt'
|
654
713
|
require_relative '../../facts/openwrt/os/release'
|
655
714
|
|