Add `systemd` config for `Promtail` monitoring `nomad`.

This commit is contained in:
Kazuhiro MUSASHI 2022-01-10 15:11:33 +09:00 committed by Gitea
parent a7363ef7b1
commit d824d6afc8
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,12 @@
[Unit]
Description=Grafana Promtail
Documentation=https://github.com/grafana/loki
After=network-online.target
[Service]
User=root
Restart=always
ExecStart=/usr/local/bin/promtail --config.file=/etc/promtail/nomad.yaml
[Install]
WantedBy=multi-user.target

View File

@ -79,3 +79,15 @@ template '/etc/promtail/nomad.yaml' do
notifies :restart, 'service[promtail-nomad]' notifies :restart, 'service[promtail-nomad]'
end end
# Deploy the `systemd` configuration:
remote_file '/lib/systemd/system/promtail-nomad.service' do
owner 'root'
group 'root'
mode '644'
end
# Service setting:
service 'promtail-nomad' do
action [ :enable, :restart ]
end