Add community prometheus cookbook
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
provides :prometheus_alertmanager_service
|
||||
unified_mode true
|
||||
|
||||
use '_partial/_common'
|
||||
use '_partial/_alertmanager'
|
||||
|
||||
default_action :create
|
||||
|
||||
action_class do
|
||||
include PrometheusCookbook::Helpers
|
||||
end
|
||||
|
||||
action :create do
|
||||
systemd_unit 'alertmanager.service' do
|
||||
content alertmanager_unit_content(new_resource)
|
||||
action [:create, :enable, :start]
|
||||
end
|
||||
end
|
||||
|
||||
action :enable do
|
||||
systemd_unit 'alertmanager.service' do
|
||||
action :enable
|
||||
end
|
||||
end
|
||||
|
||||
action :start do
|
||||
systemd_unit 'alertmanager.service' do
|
||||
action :start
|
||||
end
|
||||
end
|
||||
|
||||
action :restart do
|
||||
systemd_unit 'alertmanager.service' do
|
||||
action :restart
|
||||
end
|
||||
end
|
||||
|
||||
action :reload do
|
||||
systemd_unit 'alertmanager.service' do
|
||||
action :reload
|
||||
end
|
||||
end
|
||||
|
||||
action :stop do
|
||||
systemd_unit 'alertmanager.service' do
|
||||
action [:stop, :disable]
|
||||
end
|
||||
end
|
||||
|
||||
action :delete do
|
||||
systemd_unit 'alertmanager.service' do
|
||||
action [:stop, :disable, :delete]
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user