From 6cc480e2b5df1e96848764125b896b135ed0cb09 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Tue, 20 Aug 2024 17:39:51 +0000 Subject: [PATCH] kandra: Ensure that we do not error out creating standby.signal. Force us to have restored the `/var/lib/postgresql/14/main` directory before we try to create `standby.signal` in it. --- puppet/kandra/manifests/profile/postgresql.pp | 1 + puppet/zulip/manifests/profile/postgresql.pp | 1 + 2 files changed, 2 insertions(+) diff --git a/puppet/kandra/manifests/profile/postgresql.pp b/puppet/kandra/manifests/profile/postgresql.pp index ba639311fd..f1ef073250 100644 --- a/puppet/kandra/manifests/profile/postgresql.pp +++ b/puppet/kandra/manifests/profile/postgresql.pp @@ -50,6 +50,7 @@ class kandra::profile::postgresql inherits kandra::profile::base { require => [File['/usr/local/bin/env-wal-g'], Exec['setup_disks']], unless => "test -d /srv/data/postgresql/${zulip::postgresql_common::version}/main", timeout => 0, + before => File["${zulip::postgresql_base::postgresql_datadir}/standby.signal"], notify => Exec[$zulip::postgresql_base::postgresql_restart], } } diff --git a/puppet/zulip/manifests/profile/postgresql.pp b/puppet/zulip/manifests/profile/postgresql.pp index 891da04a28..933af589b6 100644 --- a/puppet/zulip/manifests/profile/postgresql.pp +++ b/puppet/zulip/manifests/profile/postgresql.pp @@ -59,6 +59,7 @@ class zulip::profile::postgresql { file { "${zulip::postgresql_base::postgresql_datadir}/standby.signal": ensure => file, require => Package[$zulip::postgresql_base::postgresql], + before => Exec[$zulip::postgresql_base::postgresql_restart], owner => 'postgres', group => 'postgres', mode => '0644',