Skip to content

Commit

Permalink
(puppetlabsGH-962) Allow Amazon Linux 2 and newer versions
Browse files Browse the repository at this point in the history
  • Loading branch information
rjd1 committed Mar 15, 2024
1 parent 757dc37 commit 11d9143
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,10 @@
assert_type(Pattern[/^(Debian|RedHat|windows)$/], $facts['os']['family']) |$a, $b| {
fail('This module only works on Debian, Red Hat or Windows based systems.')
}
if ($facts['os']['family'] == 'RedHat') and (versioncmp($facts['os']['release']['major'], '7') < 0) {
if ($facts['os']['family'] == 'RedHat') and ($facts['os']['name'] != 'Amazon') and (versioncmp($facts['os']['release']['major'], '7') < 0) {
fail('This module only works on Red Hat based systems version 7 and higher.')
} elsif ($facts['os']['name'] == 'Amazon') and ($facts['os']['release']['major'] != '2') and (versioncmp($facts['os']['release']['major'], '2022') < 0) {
fail('This module only works on Amazon Linux 2 and newer systems.')
}
}

Expand Down

0 comments on commit 11d9143

Please sign in to comment.