housekeep-promtail-config-for-nomad #18
|
@ -85,28 +85,24 @@ service 'nomad' do
|
||||||
action [:enable, :start]
|
action [:enable, :start]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Deploy `promtail` config:
|
# Deploy `vector` config:
|
||||||
HOSTNAME = run_command('uname -n').stdout.chomp
|
remote_file '/etc/vector/nomad.toml' do
|
||||||
|
|
||||||
template '/etc/promtail/nomad.yaml' do
|
|
||||||
owner 'root'
|
owner 'root'
|
||||||
group 'root'
|
group 'root'
|
||||||
mode '644'
|
mode '644'
|
||||||
|
|
||||||
variables(HOSTNAME: HOSTNAME, LOKIENDPOINT: node['nomad']['lokiendpoint'])
|
notifies :restart, 'service[vector-nomad]'
|
||||||
|
|
||||||
notifies :restart, 'service[promtail-nomad]'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Deploy the `systemd` configuration:
|
# Deploy the `systemd` configuration:
|
||||||
remote_file '/lib/systemd/system/promtail-nomad.service' do
|
remote_file '/lib/systemd/system/vector-nomad.service' do
|
||||||
owner 'root'
|
owner 'root'
|
||||||
group 'root'
|
group 'root'
|
||||||
mode '644'
|
mode '644'
|
||||||
end
|
end
|
||||||
|
|
||||||
# Service setting:
|
# Service setting:
|
||||||
service 'promtail-nomad' do
|
service 'vector-nomad' do
|
||||||
action [ :enable, :restart ]
|
action [ :enable, :restart ]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue