promscale_version = "0.1.4"
-database_cluster = node[:timescaledb][:cluster]
+database_cluster = "#{node[:timescaledb][:database_version]}/main"
postgresql_user "prometheus" do
cluster database_cluster
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] << {