itamae/cookbooks/prometheus/alertmanager_webhook_setup.rb

33 lines
660 B
Ruby
Raw Permalink Normal View History

2023-02-21 14:12:51 +00:00
# Deploy `systemd` config for `Alert Manager Webhook Logger`
remote_file '/etc/systemd/system/webhook.service' do
owner 'root'
group 'root'
mode '644'
2023-02-21 14:12:51 +00:00
notifies :restart, 'service[webhook]'
end
2023-02-21 14:12:51 +00:00
service 'webhook' do
action [:enable, :start]
end
# Deploy `rsyslog` config for `Alert Manager Webhook Logger`:
remote_file '/etc/rsyslog.d/30-webhook.conf' do
owner 'root'
group 'root'
mode '0644'
notifies :restart, 'service[rsyslog]'
end
service 'rsyslog' do
action :nothing
end
# Deploy `logrotate` config for `Alert Manager Webhook Logger`:
remote_file '/etc/logrotate.d/webhook' do
owner 'root'
group 'root'
mode '0644'
end