]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/postgresql/recipes/default.rb
Disable SSL for postgres 9.1 on errol
[chef.git] / cookbooks / postgresql / recipes / default.rb
index 6a05f34e4fad6412a3b5e8f6c4ff75b23be5366e..b192080fb00a7e5f3a3806bb00540ca65ed5e093 100644 (file)
@@ -155,10 +155,10 @@ clusters.each do |name, details|
 end
 
 ports = clusters.collect do |_, details|
-  "port=#{details[:port]}"
+  details[:port]
 end
 
-template "/etc/prometheus/collectors/postgres_queries.yml" do
+template "/etc/prometheus/exporters/postgres_queries.yml" do
   source "postgres_queries.yml.erb"
   owner "root"
   group "root"
@@ -168,7 +168,9 @@ end
 prometheus_exporter "postgres" do
   port 9187
   user "postgres"
-  options "--extend.query-path=/etc/prometheus/collectors/postgres_queries.yml"
-  environment "DATA_SOURCE_NAME" => "user=postgres host=/run/postgresql #{ports.join(',')}",
+  options "--extend.query-path=/etc/prometheus/exporters/postgres_queries.yml"
+  environment "DATA_SOURCE_URI" => "postgres@:#{ports.join(',:')}/postgres?host=/run/postgresql",
+              "PG_EXPORTER_AUTO_DISCOVER_DATABASES" => "true",
               "PG_EXPORTER_EXCLUDE_DATABASES" => "postgres,template0,template1"
+  subscribes :restart, "template[/etc/prometheus/exporters/postgres_queries.yml]"
 end