Add community prometheus cookbook

This commit is contained in:
Greg Karekinian
2026-07-03 16:35:26 +02:00
parent ec73dd5b57
commit 4cd6c41254
29 changed files with 1430 additions and 0 deletions
+56
View File
@@ -0,0 +1,56 @@
# frozen_string_literal: true
provides :prometheus_service
unified_mode true
use '_partial/_common'
use '_partial/_prometheus'
default_action :create
action_class do
include PrometheusCookbook::Helpers
end
action :create do
systemd_unit 'prometheus.service' do
content prometheus_unit_content(new_resource)
action [:create, :enable, :start]
end
end
action :enable do
systemd_unit 'prometheus.service' do
action :enable
end
end
action :start do
systemd_unit 'prometheus.service' do
action :start
end
end
action :restart do
systemd_unit 'prometheus.service' do
action :restart
end
end
action :reload do
systemd_unit 'prometheus.service' do
action :reload
end
end
action :stop do
systemd_unit 'prometheus.service' do
action [:stop, :disable]
end
end
action :delete do
systemd_unit 'prometheus.service' do
action [:stop, :disable, :delete]
end
end