-
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.
Browse files
Browse the repository at this point in the history
(FACT-3114) Arch Linux: Implement os version facts
- Loading branch information
Showing
4 changed files
with
26 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ module Config | |
Sled | ||
] | ||
}, | ||
'Archlinux', | ||
'Gentoo', | ||
'Alpine', | ||
'Photon', | ||
|
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 Archlinux | ||
module Os | ||
class Release | ||
FACT_NAME = 'os.release' | ||
|
||
def call_the_resolver | ||
# Arch Linux is rolling release and has no version numbers | ||
# For historical reasons facter used the kernel version as OS version on Arch Linux | ||
kernelrelease = Facter::Resolvers::Uname.resolve(:kernelrelease) | ||
versions = kernelrelease.split('.') | ||
hash = { full: kernelrelease, major: versions[0], minor: versions[1] } | ||
|
||
Facter::ResolvedFact.new(FACT_NAME, hash) | ||
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
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