Deploy config file and `supervisord` config.

This commit is contained in:
Kazuhiro MUSASHI 2020-10-24 18:54:58 +09:00
parent 3f9edd9731
commit ace020419f
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,8 @@
[program:snmp_exporter]
command=/usr/local/bin/snmp_exporter --config.file /etc/prometheus_exporters.d/snmp.yml
stdout_logfile=/var/log/supervisor/snmp_exporter.log
redirect_stderr=true
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=5
autorestart=true
stopsignal=HUP

View File

@ -0,0 +1,18 @@
# Create Link
link '/etc/prometheus_exporters.d/snmp.yml' do
to "#{node['snmp_exporter']['storage']}snmp.yml"
end
# Deploy `supervisord` config:
remote_file '/etc/supervisor/conf.d/snmp_exporter.conf' do
owner 'root'
group 'root'
mode '644'
notifies :restart, 'service[supervisor]'
end
# Restart the `supervisor`:
service 'supervisor' do
action :nothing
end