Add `logrotated` config for `nomad` log files.

```
--- /dev/null
+++ b/cookbooks/nomad/files/etc/logrotate.d/nomad
@@ -0,0 +1,13 @@
+/var/log/nomad.log
+{
+        rotate 4
+        weekly
+        missingok
+        notifempty
+        compress
+        delaycompress
+        sharedscripts
+        postrotate
+                /usr/lib/rsyslog/rsyslog-rotate
+        endscript
+}
```
This commit is contained in:
Kazuhiro MUSASHI 2022-01-10 15:27:20 +09:00 committed by Gitea
parent dffb57e2fc
commit de06f5575c
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,13 @@
/var/log/nomad.log
{
rotate 4
weekly
missingok
notifempty
compress
delaycompress
sharedscripts
postrotate
/usr/lib/rsyslog/rsyslog-rotate
endscript
}

View File

@ -103,3 +103,10 @@ end
service 'rsyslog' do service 'rsyslog' do
action [ :nothing ] action [ :nothing ]
end end
# Deploy the `logrotated` configuration:
remote_file '/etc/logrotate.d/nomad' do
owner 'root'
group 'root'
mode '644'
end