29 lines
655 B
Ruby
29 lines
655 B
Ruby
#
|
|
# Cookbook:: kosmos_prometheus
|
|
# Recipe:: alertmanager
|
|
#
|
|
|
|
include_recipe "firewall"
|
|
|
|
prometheus_alertmanager_install "alertmanager" do
|
|
version node["prometheus"]["alertmanager"]["version"]
|
|
checksum node["prometheus"]["alertmanager"]["checksum"]
|
|
end
|
|
|
|
prometheus_alertmanager_config "alertmanager"
|
|
|
|
execute "restart alertmanager config" do
|
|
command "systemctl restart alertmanager.service"
|
|
action :nothing
|
|
subscribes :run, "template[/opt/prometheus/alertmanager.yml]", :delayed
|
|
end
|
|
|
|
prometheus_alertmanager_service "alertmanager"
|
|
|
|
firewall_rule "prometheus alertmanager" do
|
|
port 9093
|
|
source "10.1.1.0/24"
|
|
protocol :tcp
|
|
command :allow
|
|
end
|