-
Notifications
You must be signed in to change notification settings - Fork 495
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(maint) Rework the OS families hierarchy (#2019)
Solaris > BSD > FreeBSD OS hierarchy was convenient to some point but is inaccurate and starts to be a pain (e.g. networking facts depends on types only known to Solaris, breaking FFI on FreeBSD). Move BSD at the same level of the Solaris OS in the hierarchy. This makes quite a lot of facts disapear, but it allows us to re-introduce them without side-effects from the Solaris facts and remove cruft added to hide facts that make no sense on FreeBSD.
- Loading branch information
Showing
227 changed files
with
2,894 additions
and
602 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# frozen_string_literal: true | ||
|
||
module Facts | ||
module Freebsd | ||
module Augeas | ||
class Version | ||
FACT_NAME = 'augeas.version' | ||
ALIASES = 'augeasversion' | ||
|
||
def call_the_resolver | ||
fact_value = Facter::Resolvers::Augeas.resolve(:augeas_version) | ||
|
||
[Facter::ResolvedFact.new(FACT_NAME, fact_value), | ||
Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)] | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
module Facts | ||
module Freebsd | ||
class Facterversion | ||
FACT_NAME = 'facterversion' | ||
|
||
def call_the_resolver | ||
fact_value = Facter::Resolvers::Facterversion.resolve(:facterversion) | ||
Facter::ResolvedFact.new(FACT_NAME, fact_value) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
module Facts | ||
module Freebsd | ||
module Identity | ||
class Gid | ||
FACT_NAME = 'identity.gid' | ||
|
||
def call_the_resolver | ||
fact_value = Facter::Resolvers::PosxIdentity.resolve(:gid) | ||
Facter::ResolvedFact.new(FACT_NAME, fact_value) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
module Facts | ||
module Freebsd | ||
module Identity | ||
class Group | ||
FACT_NAME = 'identity.group' | ||
ALIASES = 'gid' | ||
|
||
def call_the_resolver | ||
fact_value = Facter::Resolvers::PosxIdentity.resolve(:group) | ||
|
||
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)] | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
module Facts | ||
module Freebsd | ||
module Identity | ||
class Privileged | ||
FACT_NAME = 'identity.privileged' | ||
|
||
def call_the_resolver | ||
fact_value = Facter::Resolvers::PosxIdentity.resolve(:privileged) | ||
Facter::ResolvedFact.new(FACT_NAME, fact_value) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
module Facts | ||
module Freebsd | ||
module Identity | ||
class Uid | ||
FACT_NAME = 'identity.uid' | ||
|
||
def call_the_resolver | ||
fact_value = Facter::Resolvers::PosxIdentity.resolve(:uid) | ||
Facter::ResolvedFact.new(FACT_NAME, fact_value) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
module Facts | ||
module Freebsd | ||
module Identity | ||
class User | ||
FACT_NAME = 'identity.user' | ||
ALIASES = 'id' | ||
|
||
def call_the_resolver | ||
fact_value = Facter::Resolvers::PosxIdentity.resolve(:user) | ||
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)] | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
module Facts | ||
module Freebsd | ||
class Kernel | ||
FACT_NAME = 'kernel' | ||
|
||
def call_the_resolver | ||
fact_value = Facter::Resolvers::Uname.resolve(:kernelname) | ||
Facter::ResolvedFact.new(FACT_NAME, fact_value) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
module Facts | ||
module Freebsd | ||
class Kernelrelease | ||
FACT_NAME = 'kernelrelease' | ||
|
||
def call_the_resolver | ||
fact_value = Facter::Resolvers::Uname.resolve(:kernelrelease) | ||
Facter::ResolvedFact.new(FACT_NAME, fact_value) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Facts | ||
module Freebsd | ||
class Mountpoints | ||
FACT_NAME = 'mountpoints' | ||
|
||
def call_the_resolver | ||
mountpoints = Facter::Resolvers::Mountpoints.resolve(FACT_NAME.to_sym) | ||
return Facter::ResolvedFact.new(FACT_NAME, nil) unless mountpoints | ||
|
||
fact = {} | ||
mountpoints.each do |mnt| | ||
fact[mnt[:path].to_sym] = mnt.reject { |k| k == :path } | ||
end | ||
|
||
Facter::ResolvedFact.new(FACT_NAME, fact) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# frozen_string_literal: true | ||
|
||
module Facts | ||
module Freebsd | ||
class Netmask6Interfaces | ||
FACT_NAME = 'netmask6_.*' | ||
TYPE = :legacy | ||
|
||
def call_the_resolver | ||
arr = [] | ||
interfaces = Facter::Resolvers::Networking.resolve(:interfaces) | ||
interfaces&.each do |interface_name, info| | ||
arr << Facter::ResolvedFact.new("netmask6_#{interface_name}", info[:netmask6], :legacy) if info[:netmask6] | ||
end | ||
|
||
arr | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# frozen_string_literal: true | ||
|
||
module Facts | ||
module Freebsd | ||
class NetmaskInterfaces | ||
FACT_NAME = 'netmask_.*' | ||
TYPE = :legacy | ||
|
||
def call_the_resolver | ||
arr = [] | ||
interfaces = Facter::Resolvers::Networking.resolve(:interfaces) | ||
interfaces&.each do |interface_name, info| | ||
arr << Facter::ResolvedFact.new("netmask_#{interface_name}", info[:netmask], :legacy) if info[:netmask] | ||
end | ||
|
||
arr | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# frozen_string_literal: true | ||
|
||
module Facts | ||
module Freebsd | ||
class Network6Interfaces | ||
FACT_NAME = 'network6_.*' | ||
TYPE = :legacy | ||
|
||
def call_the_resolver | ||
arr = [] | ||
interfaces = Facter::Resolvers::Networking.resolve(:interfaces) | ||
interfaces&.each do |interface_name, info| | ||
arr << Facter::ResolvedFact.new("network6_#{interface_name}", info[:network6], :legacy) if info[:network6] | ||
end | ||
|
||
arr | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# frozen_string_literal: true | ||
|
||
module Facts | ||
module Freebsd | ||
class NetworkInterfaces | ||
FACT_NAME = 'network_.*' | ||
TYPE = :legacy | ||
|
||
def call_the_resolver | ||
arr = [] | ||
interfaces = Facter::Resolvers::Networking.resolve(:interfaces) | ||
interfaces&.each do |interface_name, info| | ||
arr << Facter::ResolvedFact.new("network_#{interface_name}", info[:network], :legacy) if info[:network] | ||
end | ||
|
||
arr | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
module Facts | ||
module Freebsd | ||
module Networking | ||
class Dhcp | ||
FACT_NAME = 'networking.dhcp' | ||
|
||
def call_the_resolver | ||
fact_value = Facter::Resolvers::Networking.resolve(:dhcp) | ||
|
||
Facter::ResolvedFact.new(FACT_NAME, fact_value) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
module Facts | ||
module Freebsd | ||
module Networking | ||
class Domain | ||
FACT_NAME = 'networking.domain' | ||
ALIASES = 'domain' | ||
|
||
def call_the_resolver | ||
fact_value = Facter::Resolvers::Hostname.resolve(:domain) | ||
|
||
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)] | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
module Facts | ||
module Freebsd | ||
module Networking | ||
class Fqdn | ||
FACT_NAME = 'networking.fqdn' | ||
ALIASES = 'fqdn' | ||
|
||
def call_the_resolver | ||
fact_value = Facter::Resolvers::Hostname.resolve(:fqdn) | ||
|
||
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)] | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
module Facts | ||
module Freebsd | ||
module Networking | ||
class Hostname | ||
FACT_NAME = 'networking.hostname' | ||
ALIASES = 'hostname' | ||
|
||
def call_the_resolver | ||
fact_value = Facter::Resolvers::Hostname.resolve(:hostname) | ||
|
||
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)] | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
module Facts | ||
module Freebsd | ||
module Networking | ||
class Interfaces | ||
FACT_NAME = 'networking.interfaces' | ||
|
||
def call_the_resolver | ||
fact_value = Facter::Resolvers::Networking.resolve(:interfaces) | ||
|
||
Facter::ResolvedFact.new(FACT_NAME, fact_value) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
module Facts | ||
module Freebsd | ||
module Networking | ||
class Ip | ||
FACT_NAME = 'networking.ip' | ||
ALIASES = 'ipaddress' | ||
|
||
def call_the_resolver | ||
fact_value = Facter::Resolvers::Networking.resolve(:ip) | ||
|
||
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)] | ||
end | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.