diff --git a/cookbooks/nomad/files/etc/rsyslog.d/30-nomad.conf b/cookbooks/nomad/files/etc/rsyslog.d/30-nomad.conf new file mode 100644 index 0000000..9c26961 --- /dev/null +++ b/cookbooks/nomad/files/etc/rsyslog.d/30-nomad.conf @@ -0,0 +1,7 @@ +# Log kernel generated promtail log messages to file +:syslogtag,contains,"nomad" /var/log/nomad.log + +# Uncomment the following to stop logging anything that matches the last rule. +# Doing this will stop logging kernel generated UFW log messages to the file +# normally containing kern.* messages (eg, /var/log/kern.log) +& stop diff --git a/cookbooks/nomad/setup.rb b/cookbooks/nomad/setup.rb index a2a5bcd..2f2ddea 100644 --- a/cookbooks/nomad/setup.rb +++ b/cookbooks/nomad/setup.rb @@ -91,3 +91,15 @@ end service 'promtail-nomad' do action [ :enable, :restart ] end + +remote_file '/etc/rsyslog.d/30-nomad.conf' do + owner 'root' + group 'root' + mode '644' + + notifies :restart, 'service[rsyslog]' +end + +service 'rsyslog' do + action [ :nothing ] +end