itamae/cookbooks/prometheus-exporters/filestat_exporter_setup.rb

46 lines
867 B
Ruby

# Deploy the `supervisord` configuration:
remote_file '/etc/prometheus_exporters.d/filestat.yml' do
owner 'root'
group 'root'
mode '644'
notifies :restart, 'service[supervisor]'
end
# Deploy the `systemd` configuration:
remote_file '/etc/systemd/system/filestat_exporter.service' do
owner 'root'
group 'root'
mode '644'
end
service 'filestat_exporter' do
action [:enable, :start]
end
# Deploy `rsyslog` config:
remote_file '/etc/rsyslog.d/30-filestat_exporter.conf' do
owner 'root'
group 'root'
mode '644'
notifies :restart, 'service[rsyslog]'
end
service 'rsyslog' do
action :nothing
end
# Deploy `consul` config for `filestat_exporter`:
remote_file '/etc/consul.d/service-filestat_exporter.json' do
owner 'consul'
group 'consul'
mode '644'
notifies :reload, 'service[consul]'
end
service 'consul' do
action :nothing
end