]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/prometheus/resources/exporter.rb
Enable wireguard on jakelong
[chef.git] / cookbooks / prometheus / resources / exporter.rb
index c75248f99f559311a123b92c5e11eeaba3d5e693..08c0e03b749a4f83e44f8c503be246652352dfa9 100644 (file)
@@ -77,7 +77,11 @@ action_class do
   end
 
   def listen_address
-    "#{node[:prometheus][:address]}:#{new_resource.port}"
+    if node[:prometheus][:mode] == "wireguard"
+      "[#{node[:prometheus][:address]}]:#{new_resource.port}"
+    else
+      "#{node[:prometheus][:address]}:#{new_resource.port}"
+    end
   end
 
   def service_name