]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/postgresql/recipes/default.rb
Stop trying to URI encode passwords
[chef.git] / cookbooks / postgresql / recipes / default.rb
index ed58edb717a89dc96c8ae3500434a10ab1d49a50..1fe903022166d9304704a230fb236f854b227941 100644 (file)
@@ -108,10 +108,6 @@ ohai_plugin "postgresql" do
   template "ohai.rb.erb"
 end
 
-file "/etc/prometheus/exporters/postgres_queries.yml" do
-  action :delete
-end
-
 package "pgtop"
 package "libdbd-pg-perl"
 
@@ -135,7 +131,6 @@ clusters.each do |name, details|
     labels "cluster" => name
     scrape_interval "1m"
     scrape_timeout "1m"
-    user "postgres"
     options %w[
       --collector.database_wraparound
       --collector.long_running_transactions
@@ -144,9 +139,8 @@ clusters.each do |name, details|
       --collector.stat_wal_receiver
       --collector.statio_user_indexes
     ]
-    environment "DATA_SOURCE_NAME" => "postgres:///#{prometheus_database}?host=/run/postgresql&port=#{details[:port]}"
+    environment "DATA_SOURCE_NAME" => "postgres:///#{prometheus_database}?host=/run/postgresql&port=#{details[:port]}&user=prometheus&password=#{passwords['prometheus']}"
     restrict_address_families "AF_UNIX"
-    remove_ipc false
     subscribes :restart, "template[/etc/prometheus/exporters/postgres_queries.yml]"
   end
 
@@ -190,11 +184,3 @@ clusters.each do |name, details|
     conf_variables :port => details[:port]
   end
 end
-
-service "prometheus-postgres-exporter" do
-  action [:stop, :disable]
-end
-
-systemd_service "prometheus-postgres-exporter" do
-  action :delete
-end