File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
ansible/files/admin_api_scripts/pg_upgrade_scripts Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ SCRIPT_DIR=$(dirname -- "$0";)
11
11
# shellcheck disable=SC1091
12
12
source " $SCRIPT_DIR /common.sh"
13
13
14
- LOG_FILE=" /tmp /pg-upgrade-complete.log"
14
+ LOG_FILE=" /var/log /pg-upgrade-complete.log"
15
15
16
16
function cleanup {
17
17
UPGRADE_STATUS=${1:- " failed" }
@@ -45,6 +45,9 @@ function complete_pg_upgrade {
45
45
echo " 4. Running generated SQL files"
46
46
retry 3 run_generated_sql
47
47
48
+ echo " 4.1. Applying correct authentication scheme"
49
+ retry 3 use_corect_auth_scheme
50
+
48
51
sleep 5
49
52
50
53
echo " 5. Restarting postgresql"
@@ -70,6 +73,15 @@ function run_generated_sql {
70
73
fi
71
74
}
72
75
76
+ # Projects which had their passwords hashed using md5 need be
77
+ # configured to use md5 on upgraded instances as well, as opposed to scram-sha-256
78
+ function use_corect_auth_scheme {
79
+ PASSWORD_ENCRYPTION_SETTING=$( run_sql -A -t -c " SHOW password_encryption;" )
80
+ if [ " $PASSWORD_ENCRYPTION_SETTING " = " md5" ]; then
81
+ sed -i ' s/scram-sha-256/md5/g' /etc/postgresql/pg_hba.conf
82
+ fi
83
+ }
84
+
73
85
function start_vacuum_analyze {
74
86
echo " complete" > /tmp/pg-upgrade-status
75
87
su -c ' vacuumdb --all --analyze-in-stages' -s " $SHELL " postgres
Original file line number Diff line number Diff line change 282
282
mkdir -p " $MOUNT_POINT /conf"
283
283
cp -R /etc/postgresql-custom/* " $MOUNT_POINT /conf/"
284
284
285
+ # removing wal-g config as to allow it to be explicitly enabled on the new instance
286
+ rm -f " $MOUNT_POINT /conf/wal-g.conf"
287
+
285
288
# copy sql files generated by pg_upgrade
286
289
echo " 11. Copying sql files generated by pg_upgrade"
287
290
mkdir -p " $MOUNT_POINT /sql"
You can’t perform that action at this time.
0 commit comments