]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/mysql/recipes/default.rb
mail: fix typo on community.openstreetmap.org domain
[chef.git] / cookbooks / mysql / recipes / default.rb
index 99c086519a2ae8f3d031f73a724b1b25f1092a3a..d0d7b1679230c2448f0d7278c9207913923cf7ea 100644 (file)
@@ -18,6 +18,7 @@
 #
 
 include_recipe "munin"
 #
 
 include_recipe "munin"
+include_recipe "prometheus"
 
 package "mysql-server"
 package "mysql-client"
 
 package "mysql-server"
 package "mysql-client"
@@ -59,3 +60,16 @@ end
     action :delete
   end
 end
     action :delete
   end
 end
+
+mysql_password = persistent_token("mysql", "prometheus", "password")
+
+mysql_user "prometheus" do
+  password mysql_password
+  process true
+  repl_client true
+end
+
+prometheus_exporter "mysqld" do
+  port 9104
+  environment "DATA_SOURCE_NAME" => "prometheus:#{mysql_password}@(localhost:3306)/"
+end