]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/prometheus/recipes/server.rb
Link promtool and amtool to local bin directory
[chef.git] / cookbooks / prometheus / recipes / server.rb
index fab3f4652605769c7310c8b04a5c6105b59cf5f7..cee5443a16d80bc078686f2c363f7bb477a24cdb 100644 (file)
@@ -302,6 +302,10 @@ systemd_service "prometheus-alertmanager-executable" do
   notifies :restart, "service[prometheus-alertmanager]"
 end
 
+link "/usr/local/bin/promtool" do
+  to "/opt/prometheus-server/prometheus/promtool"
+end
+
 template "/etc/prometheus/alertmanager.yml" do
   source "alertmanager.yml.erb"
   owner "root"
@@ -315,13 +319,23 @@ service "prometheus-alertmanager" do
   subscribes :restart, "archive_file[#{cache_dir}/alertmanager.linux-amd64.tar.gz]"
 end
 
-template "/etc/prometheus/amtool.yml" do
+directory "/etc/amtool" do
+  owner "root"
+  group "root"
+  mode "755"
+end
+
+template "/etc/amtool/config.yml" do
   source "amtool.yml.erb"
   owner "root"
   group "root"
   mode "644"
 end
 
+link "/usr/local/bin/amtool" do
+  to "/opt/prometheus-server/alertmanager/amtool"
+end
+
 template "/etc/prometheus/karma.yml" do
   source "karma.yml.erb"
   owner "root"