(FACT-3451) Restore os facts for AmazonLinux 2 #2661
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Commit abba895 changed the
os.releaseandos.distro.releasefacts on Amazon Linux to query the os-release rpm, effectively running this command:This was appropriate for AL2023, but it introduced a regression on AL2 because the
os.release.majorandos.distro.release.majorfacts changed from "2" to a year-based version like:Since the
os.release.majorfact changed from 2 to 2017, the systemd service provider was no longer the default on AL2[1]AL1 was seemingly unaffected because we were already using a year-based version string and both
VERSIONandVERSION_IDwere the same:This commit restores the behavior for AL1 and AL2 to use
/etc/system-release. On AL2, themajorversion will be reported as2instead of20xx.This commit preserves the AL2023 behavior so it uses the os-release rpm to report the
majorversion2023.[1] https://github.com/puppetlabs/puppet/blob/8.3.1/lib/puppet/provider/service/systemd.rb#L22