From 7f16c07b791755cb938d3851fd990c5f5a995c53 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Tue, 20 Mar 2018 17:01:40 +0100 Subject: Added policy to limit the number of kernels to 2 on centos hosts --- services/os/centos.cf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/services/os/centos.cf b/services/os/centos.cf index 989fb46..f6673e2 100644 --- a/services/os/centos.cf +++ b/services/os/centos.cf @@ -25,7 +25,17 @@ bundle agent centos "wget", "yum-utils", }; + files: + centos:: + "/etc/yum.conf" + edit_defaults => std_defs, + perms => system_owned("444"), + edit_line => regex_replace(".*installonly_limit=(?!2).*", "installonly_limit=2"), + classes => if_repaired("yum_conf_file_repaired"); methods: centos:: "centos" usebundle => install_package("$(this.bundle)", "$(centos.packages)"); + reports: + any:: + "$(this.bundle): /etc/yum.conf repaired" ifvarclass => "yum_conf_file_repaired"; } -- cgit v1.2.3