Use the systemd unit instead of an execute resource

Also extract the attributes so it is possible to override them.
This commit is contained in:
Greg Karekinian 2025-05-21 13:40:12 +02:00
parent 49b636305e
commit 7dc4f674a0
2 changed files with 7 additions and 8 deletions

View File

@ -0,0 +1,2 @@
node.default["kosmos-base"]["journald"]["system_max_use"] = "256M"
node.default["kosmos-base"]["journald"]["max_retention_sec"] = "7d"

View File

@ -3,15 +3,12 @@
# Recipe:: journald_conf # Recipe:: journald_conf
# #
service "systemd-journald"
template "/etc/systemd/journald.conf" do template "/etc/systemd/journald.conf" do
source "journald.conf.erb" source "journald.conf.erb"
variables system_max_use: "256M", variables system_max_use: node["kosmos-base"]["journald"]["system_max_use"],
max_retention_sec: "7d" max_retention_sec: node["kosmos-base"]["journald"]["max_retention_sec"]
# Restarting journald is required # Restarting journald is required
notifies :run, "execute[systemctl restart systemd-journald.service]", :delayed notifies :restart, "service[systemd-journald]", :delayed
end
execute "systemctl restart systemd-journald.service" do
command "systemctl restart systemd-journald.service"
action :nothing
end end