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:
parent
49b636305e
commit
7dc4f674a0
2
site-cookbooks/kosmos-base/attributes/default.rb
Normal file
2
site-cookbooks/kosmos-base/attributes/default.rb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
node.default["kosmos-base"]["journald"]["system_max_use"] = "256M"
|
||||||
|
node.default["kosmos-base"]["journald"]["max_retention_sec"] = "7d"
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user