]> git.openstreetmap.org Git - chef.git/commitdiff
Enable resolved prometheus exporter
authorTom Hughes <tom@compton.nu>
Sat, 23 Nov 2024 12:44:45 +0000 (12:44 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 23 Nov 2024 15:04:48 +0000 (15:04 +0000)
cookbooks/networking/metadata.rb
cookbooks/networking/recipes/default.rb

index c37012709faf15c9ef5d126c3153770ca8b6d3d2..33baab1f426c289e798e6de1e521b0d6523c853e 100644 (file)
@@ -6,3 +6,4 @@ description       "Configures networking"
 
 version           "1.0.0"
 depends           "chef"
+depends           "ruby"
index ea87c3b7b0b4ab94264d558bcf5571c46dc54dcf..2f60280f06172dec3ba73f8f80c6fae6abcecfaa 100644 (file)
@@ -23,6 +23,8 @@
 require "ipaddr"
 require "yaml"
 
+include_recipe "ruby"
+
 keys = data_bag_item("networking", "keys")
 
 file "/etc/netplan/00-installer-config.yaml" do
@@ -331,6 +333,16 @@ link "/etc/resolv.conf" do
   to "../run/systemd/resolve/stub-resolv.conf"
 end
 
+gem_package "dbus-systemd" do
+  gem_binary node[:ruby][:gem]
+end
+
+prometheus_exporter "resolved" do
+  port 10028
+  user "systemd-resolve"
+  restrict_address_families "AF_UNIX"
+end
+
 hosts = { :inet => [], :inet6 => [] }
 
 search(:node, "networking:interfaces").collect do |n|