Skip to content

Commit 2bcfb74

Browse files
authored
Merge pull request #972 from rjd1/main
(GH-962) Allow Amazon Linux 2 and newer versions
2 parents c99e45e + d3acf06 commit 2bcfb74

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

manifests/init.pp

+3-1
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,10 @@
478478
assert_type(Pattern[/^(Debian|RedHat|windows)$/], $facts['os']['family']) |$a, $b| {
479479
fail('This module only works on Debian, Red Hat or Windows based systems.')
480480
}
481-
if ($facts['os']['family'] == 'RedHat') and (versioncmp($facts['os']['release']['major'], '7') < 0) {
481+
if ($facts['os']['family'] == 'RedHat') and ($facts['os']['name'] != 'Amazon') and (versioncmp($facts['os']['release']['major'], '7') < 0) {
482482
fail('This module only works on Red Hat based systems version 7 and higher.')
483+
} elsif ($facts['os']['name'] == 'Amazon') and ($facts['os']['release']['major'] != '2') and (versioncmp($facts['os']['release']['major'], '2022') < 0) {
484+
fail('This module only works on Amazon Linux 2 and newer systems.')
483485
}
484486
}
485487

0 commit comments

Comments
 (0)