Deploy `/etc/vector/alertmanager.toml`.

This commit is contained in:
Kazuhiro MUSASHI 2023-02-16 21:37:11 +09:00
parent 1e31bff167
commit 6788676faa
2 changed files with 29 additions and 0 deletions

View File

@ -61,6 +61,19 @@ remote_file '/etc/logrotate.d/alertmanager' do
mode '644' mode '644'
end end
# Deploy `vector` config for `alertmanager`:
remote_file '/etc/vector/alertmanager.toml' do
owner 'root'
group 'root'
mode '644'
notifies :restart, 'service[vector-alertmanager]'
end
service 'vector-alertmanager' do
action [:enable, :start]
end
# Firewall settings here: # Firewall settings here:
%w( 9093/tcp ).each do |p| %w( 9093/tcp ).each do |p|
execute "ufw allow #{p}" do execute "ufw allow #{p}" do

View File

@ -0,0 +1,16 @@
[Unit]
Description=Vector
Documentation=https://vector.dev
After=network-online.target
Requires=network-online.target
[Service]
ExecStart=/usr/bin/vector --config /etc/vector/alertmanager.toml
ExecReload=/bin/kill -HUP $MAINPID
Restart=always
StandardOutput=journal
StandardError=journal
SyslogIdentifier=vector
[Install]
WantedBy=multi-user.target