From 5e6ce67c38f37314f1ef2cb6fe38fcc1ca94e40e Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sat, 4 Oct 2025 15:59:14 +0100 Subject: [PATCH] Only try and create standby.signal if the cluster exists --- cookbooks/postgresql/recipes/default.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cookbooks/postgresql/recipes/default.rb b/cookbooks/postgresql/recipes/default.rb index 53a64fbd0..1281fb3df 100644 --- a/cookbooks/postgresql/recipes/default.rb +++ b/cookbooks/postgresql/recipes/default.rb @@ -90,10 +90,12 @@ node[:postgresql][:versions].each do |version| owner "postgres" group "postgres" mode "640" + only_if { ::Dir.exist?("/var/lib/postgresql/#{version}/main") } end else file "/var/lib/postgresql/#{version}/main/standby.signal" do action :delete + only_if { ::Dir.exist?("/var/lib/postgresql/#{version}/main") } end end end -- 2.39.5