X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/5f4e541fce6e3ece45edcf8b391edd3fc330ce38..c87a97890768b4427f078d7deda0d1edf4bb39ce:/cookbooks/prometheus/recipes/server.rb diff --git a/cookbooks/prometheus/recipes/server.rb b/cookbooks/prometheus/recipes/server.rb index 7e4f4b2bf..b4a4c36da 100644 --- a/cookbooks/prometheus/recipes/server.rb +++ b/cookbooks/prometheus/recipes/server.rb @@ -39,7 +39,7 @@ package %w[ promscale_version = "0.1.4" -database_cluster = node[:timescaledb][:cluster] +database_cluster = "#{node[:timescaledb][:database_version]}/main" postgresql_user "prometheus" do cluster database_cluster @@ -144,8 +144,24 @@ systemd_timer "promscale-maintenance" do on_unit_inactive_sec 1800 end +service "promscale-maintenance.timer" do + action [:enable, :start] +end + jobs = {} +search(:node, "roles:gateway") do |gateway| + allowed_ips = gateway.interfaces(:role => :internal).map do |interface| + "#{interface[:network]}/#{interface[:prefix]}" + end + + node.default[:networking][:wireguard][:peers] << { + :public_key => gateway[:networking][:wireguard][:public_key], + :allowed_ips => allowed_ips, + :endpoint => "#{gateway.name}:51820" + } +end + search(:node, "recipes:prometheus\\:\\:default").sort_by(&:name).each do |client| if client[:prometheus][:mode] == "wireguard" node.default[:networking][:wireguard][:peers] << {