From adc7bf8574226bed8551e80d1b46cc23169ef28e Mon Sep 17 00:00:00 2001 From: Erik Geiger Date: Thu, 11 Nov 2021 11:38:54 +0100 Subject: [PATCH 1/3] fixing Amazon Linux 2 support --- manifests/params.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 7813b83..03e10da 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -60,7 +60,7 @@ case $::operatingsystem { 'Amazon': { case $::operatingsystemmajrelease { - '2016', '2018': { + '2': { $monit_version = '5' $config_file = '/etc/monit.conf' } From 500670b0bdfe313b5acb1cadc5d3f861554b1b34 Mon Sep 17 00:00:00 2001 From: Erik Geiger Date: Wed, 3 Aug 2022 15:58:00 +0200 Subject: [PATCH 2/3] fixing Amazon Linux 2 support. Monit defaults to reading monitrc file, not monit.conf on Amazon Linux 2 --- manifests/params.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 03e10da..d294507 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -62,7 +62,7 @@ case $::operatingsystemmajrelease { '2': { $monit_version = '5' - $config_file = '/etc/monit.conf' + $config_file = '/etc/monitrc' } default: { fail("monit supports Amazon Linux 2. Detected operatingsystemmajrelease is <${::operatingsystemmajrelease}>.") From 241d6008abcc01bbf01a8a9024a94d51e8e785af Mon Sep 17 00:00:00 2001 From: Erik Geiger <40165048+erik-frontify@users.noreply.github.com> Date: Fri, 16 Feb 2024 13:26:24 +0100 Subject: [PATCH 3/3] Update params.pp Sorry, I just figured that the whole switch case for Amazon Linux doesn't make sense any more as Amazon Linux 2 is similar to the RedHat default --- manifests/params.pp | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 714c046..d0e0199 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -41,24 +41,8 @@ 'RedHat': { $config_dir = '/etc/monit.d' $service_hasstatus = true - - case $facts['os']['name'] { - 'Amazon': { - case $::operatingsystemmajrelease { - '2': { - $monit_version = '5' - $config_file = '/etc/monitrc' - } - default: { - fail("monit supports Amazon Linux 2. Detected operatingsystemmajrelease is <${::operatingsystemmajrelease}>.") - } - } - } - default: { - $monit_version = '5' - $config_file = '/etc/monitrc' - } - } + $monit_version = '5' + $config_file = '/etc/monitrc' } default: { fail("monit supports osfamilies Debian and RedHat. Detected osfamily is <${facts['os']['family']}>.")