Deploy `promtail` config & `systemd` config.

This commit is contained in:
Kazuhiro MUSASHI 2020-09-07 23:15:53 +09:00
parent 8485309442
commit c599fccc2b
1 changed files with 23 additions and 0 deletions

View File

@ -68,3 +68,26 @@ end
service 'nginx' do service 'nginx' do
action [ :enable, :start ] action [ :enable, :start ]
end end
# Deploy `promtail` config file:
HOSTNAME = run_command('uname -n').stdout.chomp
template '/etc/promtail/nginx.yaml' do
owner 'root'
group 'root'
mode '644'
variables(HOSTNAME: HOSTNAME, LOKIENDPOINT: node['promtail']['lokiendpoint'])
end
# Deploy the `systemd` configuration:
remote_file '/lib/systemd/system/promtail-nginx.service' do
owner 'root'
group 'root'
mode '644'
end
# Service setting:
service 'promtail-nginx' do
action [ :enable, :restart ]
end