]> 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 94e33c033842f5f30a7f6a97f4c1ad3b3880ccec..cee5443a16d80bc078686f2c363f7bb477a24cdb 100644 (file)
@@ -18,7 +18,8 @@
 #
 
 include_recipe "apache"
-include_recipe "apt"
+include_recipe "apt::grafana"
+include_recipe "apt::timescaledb"
 include_recipe "networking"
 include_recipe "timescaledb"
 
@@ -301,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"
@@ -314,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"