From de06f5575ce8fed164e65a3f5c8d83675fd419fd Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Mon, 10 Jan 2022 15:27:20 +0900 Subject: [PATCH] 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 +} ``` --- cookbooks/nomad/files/etc/logrotate.d/nomad | 13 +++++++++++++ cookbooks/nomad/setup.rb | 7 +++++++ 2 files changed, 20 insertions(+) create mode 100644 cookbooks/nomad/files/etc/logrotate.d/nomad diff --git a/cookbooks/nomad/files/etc/logrotate.d/nomad b/cookbooks/nomad/files/etc/logrotate.d/nomad new file mode 100644 index 0000000..adf7b5d --- /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 +} diff --git a/cookbooks/nomad/setup.rb b/cookbooks/nomad/setup.rb index 2f2ddea..c9e7cb9 100644 --- a/cookbooks/nomad/setup.rb +++ b/cookbooks/nomad/setup.rb @@ -103,3 +103,10 @@ end service 'rsyslog' do action [ :nothing ] end + +# Deploy the `logrotated` configuration: +remote_file '/etc/logrotate.d/nomad' do + owner 'root' + group 'root' + mode '644' +end