]> git.openstreetmap.org Git - chef.git/commitdiff
Restart cloudwatch exporter when the configuration changes
authorTom Hughes <tom@compton.nu>
Tue, 10 Oct 2023 23:58:52 +0000 (00:58 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 10 Oct 2023 23:58:52 +0000 (00:58 +0100)
cookbooks/prometheus/recipes/server.rb

index 1a6639abea6d5a7ee995368f39d3318642ad4951..902844c3d8826dd57976e9e78305fa797fb22fec 100644 (file)
@@ -58,6 +58,7 @@ prometheus_exporter "cloudwatch" do
   options "--config.file=/etc/prometheus/cloudwatch.yml"
   environment "AWS_ACCESS_KEY_ID" => "AKIASQUXHPE7JHG37EA6",
               "AWS_SECRET_ACCESS_KEY" => tokens["cloudwatch"]
+  subscribes :restart, "template[/etc/prometheus/cloudwatch.yml]"
 end
 
 cache_dir = Chef::Config[:file_cache_path]