X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/127bbb52c27974a9ea5558b52731abe08bda90a1..7a100e1f0604b3374a42b8e29a3ea429a1558883:/cookbooks/postgresql/recipes/default.rb diff --git a/cookbooks/postgresql/recipes/default.rb b/cookbooks/postgresql/recipes/default.rb index 07e59cbce..a3ef7d23d 100644 --- a/cookbooks/postgresql/recipes/default.rb +++ b/cookbooks/postgresql/recipes/default.rb @@ -35,7 +35,6 @@ node[:postgresql][:versions].each do |version| standby_mode = settings[:standby_mode] || defaults[:standby_mode] primary_conninfo = settings[:primary_conninfo] || defaults[:primary_conninfo] - restore_command = settings[:restore_command] || defaults[:restore_command] passwords = if primary_conninfo data_bag_item(primary_conninfo[:passwords][:bag], @@ -87,28 +86,7 @@ node[:postgresql][:versions].each do |version| only_if { ::Dir.exist?("/var/lib/postgresql/#{version}/main") } end - if version.to_f < 12 && (restore_command || standby_mode == "on") - template "/var/lib/postgresql/#{version}/main/recovery.conf" do - source "recovery.conf.erb" - owner "postgres" - group "postgres" - mode "640" - variables :standby_mode => standby_mode, - :primary_conninfo => primary_conninfo, - :restore_command => restore_command, - :passwords => passwords - notifies :reload, "service[postgresql]" - only_if { ::Dir.exist?("/var/lib/postgresql/#{version}/main") } - end - else - template "/var/lib/postgresql/#{version}/main/recovery.conf" do - action :delete - notifies :reload, "service[postgresql]" - only_if { ::Dir.exist?("/var/lib/postgresql/#{version}/main") } - end - end - - if version.to_f > 11 && standby_mode == "on" + if standby_mode == "on" file "/var/lib/postgresql/#{version}/main/standby.signal" do owner "postgres" group "postgres" @@ -198,5 +176,6 @@ prometheus_exporter "postgres" do "PG_EXPORTER_AUTO_DISCOVER_DATABASES" => "true", "PG_EXPORTER_EXCLUDE_DATABASES" => "postgres,template0,template1" restrict_address_families "AF_UNIX" + remove_ipc false subscribes :restart, "template[/etc/prometheus/exporters/postgres_queries.yml]" end