Skip to content

Commit 4953c6b

Browse files
committed
chore: handle case when data dir isn't symlinked (dedicated data disk doesn't exist)
1 parent 07f2492 commit 4953c6b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

ansible/files/admin_api_scripts/pg_upgrade_initiate.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ function initiate_upgrade {
106106
cp /root/pg_upgrade_pgsodium_getkey.sh "$PGSHARENEW/extension/pgsodium_getkey"
107107
chmod +x "$PGSHARENEW/extension/pgsodium_getkey"
108108

109-
if [ -f "$MOUNTPOINT/pgsodium_root.key" ]; then
110-
cp "$MOUNTPOINT/pgsodium_root.key" /etc/postgresql-custom/pgsodium_root.key
109+
if [ -f "$MOUNT_POINT/pgsodium_root.key" ]; then
110+
cp "$MOUNT_POINT/pgsodium_root.key" /etc/postgresql-custom/pgsodium_root.key
111111
chown postgres:postgres /etc/postgresql-custom/pgsodium_root.key
112112
chmod 600 /etc/postgresql-custom/pgsodium_root.key
113113
fi
@@ -147,6 +147,10 @@ EOF
147147
mv /var/lib/postgresql /var/lib/postgresql.bak
148148
ln -s /tmp/pg_upgrade_bin/15/share /var/lib/postgresql
149149

150+
if [ ! -L /var/lib/postgresql.bak/data ]; then
151+
ln -s /var/lib/postgresql.bak/data /var/lib/postgresql/data
152+
fi
153+
150154
systemctl stop postgresql
151155
su -c "$UPGRADE_COMMAND" -s $SHELL postgres
152156

common.vars.pkr.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
postgres-version = "15.1.0.28"
1+
postgres-version = "15.1.0.29"

0 commit comments

Comments
 (0)