From d3acf061d3bf22f2d542c7b4e6503a93d301fe76 Mon Sep 17 00:00:00 2001 From: Ryan Dill Date: Fri, 15 Mar 2024 18:08:06 +0800 Subject: [PATCH] (GH-962) Allow Amazon Linux 2 and newer versions --- manifests/init.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index 29984e62..ac10e1be 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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.') } }