2021-05-01 09:13:25 +00:00
|
|
|
# Create `/var/log/vector`:
|
2022-07-10 07:31:55 +00:00
|
|
|
%w( conf templates tokens ).each do |d|
|
|
|
|
directory "/etc/consul-template.d/#{d}" do
|
2021-05-01 09:13:25 +00:00
|
|
|
owner 'root'
|
|
|
|
group 'root'
|
|
|
|
mode '0755'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
%w( /etc/systemd/system/consul-template.service /etc/default/consul-template).each do |conf|
|
|
|
|
remote_file conf do
|
|
|
|
owner 'root'
|
|
|
|
group 'root'
|
|
|
|
mode '0644'
|
|
|
|
|
|
|
|
notifies :run, 'execute[systemctl daemon-reload]', :immediately
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
execute 'systemctl daemon-reload' do
|
|
|
|
action :nothing
|
|
|
|
end
|
|
|
|
|
|
|
|
service 'consul-template' do
|
|
|
|
action [:enable, :restart]
|
|
|
|
end
|
|
|
|
|
|
|
|
remote_file '/etc/rsyslog.d/30-consul-template.conf' do
|
|
|
|
owner 'root'
|
|
|
|
group 'root'
|
|
|
|
mode '0644'
|
|
|
|
|
|
|
|
notifies :restart, 'service[rsyslog]', :immediately
|
|
|
|
end
|
|
|
|
|
|
|
|
service 'rsyslog' do
|
|
|
|
action [ :nothing ]
|
|
|
|
end
|
|
|
|
|