From 11fdeeaa56975b200a46cc3ee7124e529621fba9 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Tue, 3 Dec 2024 15:51:22 +0000 Subject: [PATCH] Add logrotate where required --- cookbooks/apache/recipes/default.rb | 1 + cookbooks/chef/recipes/default.rb | 2 ++ cookbooks/fail2ban/recipes/default.rb | 1 + cookbooks/logstash/recipes/default.rb | 1 + cookbooks/nginx/recipes/default.rb | 5 ++++- cookbooks/oxidized/recipes/default.rb | 1 + 6 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cookbooks/apache/recipes/default.rb b/cookbooks/apache/recipes/default.rb index d1a0aac1d..cade29d31 100644 --- a/cookbooks/apache/recipes/default.rb +++ b/cookbooks/apache/recipes/default.rb @@ -24,6 +24,7 @@ include_recipe "ssl" package %w[ apache2 libwww-perl + logrotate ] %w[event itk prefork worker].each do |mpm| diff --git a/cookbooks/chef/recipes/default.rb b/cookbooks/chef/recipes/default.rb index a27b99cbd..129888c95 100644 --- a/cookbooks/chef/recipes/default.rb +++ b/cookbooks/chef/recipes/default.rb @@ -101,6 +101,8 @@ template "/etc/chef/report.rb" do mode "644" end +package "logrotate" + template "/etc/logrotate.d/chef" do source "logrotate.erb" owner "root" diff --git a/cookbooks/fail2ban/recipes/default.rb b/cookbooks/fail2ban/recipes/default.rb index 216572989..a218eb580 100644 --- a/cookbooks/fail2ban/recipes/default.rb +++ b/cookbooks/fail2ban/recipes/default.rb @@ -23,6 +23,7 @@ package %w[ fail2ban python3-systemd ruby-webrick + logrotate ] if platform?("debian") diff --git a/cookbooks/logstash/recipes/default.rb b/cookbooks/logstash/recipes/default.rb index bbe845021..46bc3fea0 100644 --- a/cookbooks/logstash/recipes/default.rb +++ b/cookbooks/logstash/recipes/default.rb @@ -25,6 +25,7 @@ keys = data_bag_item("logstash", "keys") package %w[ openjdk-11-jre-headless logstash + logrotate ] cookbook_file "/var/lib/logstash/beats.crt" do diff --git a/cookbooks/nginx/recipes/default.rb b/cookbooks/nginx/recipes/default.rb index d8e9d4d2b..3fcb20fdb 100644 --- a/cookbooks/nginx/recipes/default.rb +++ b/cookbooks/nginx/recipes/default.rb @@ -21,7 +21,10 @@ include_recipe "apt::nginx" include_recipe "prometheus" include_recipe "ssl" -package "nginx" +package %w[ + nginx + logrotate +] template "/etc/nginx/nginx.conf" do source "nginx.conf.erb" diff --git a/cookbooks/oxidized/recipes/default.rb b/cookbooks/oxidized/recipes/default.rb index 66c919908..fce3126d3 100644 --- a/cookbooks/oxidized/recipes/default.rb +++ b/cookbooks/oxidized/recipes/default.rb @@ -30,6 +30,7 @@ package %w[ zlib1g-dev pkg-config libyaml-dev + logrotate ] keys = data_bag_item("oxidized", "keys") -- 2.39.5