From 532be386fce0a471162c053edaf90bf783e8576d Mon Sep 17 00:00:00 2001 From: aknochow Date: Wed, 18 Sep 2024 13:24:18 -0400 Subject: [PATCH] fix postgres user permissions for upgrades (#1959) --- roles/installer/tasks/upgrade_postgres.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/installer/tasks/upgrade_postgres.yml b/roles/installer/tasks/upgrade_postgres.yml index f8f7a765..ecf2225b 100644 --- a/roles/installer/tasks/upgrade_postgres.yml +++ b/roles/installer/tasks/upgrade_postgres.yml @@ -118,7 +118,9 @@ trap 'end_keepalive \"$keepalive_file\" \"$keepalive_pid\"' EXIT SIGINT SIGTERM echo keepalive_pid: $keepalive_pid set -e -o pipefail + psql -c 'GRANT postgres TO {{ awx_postgres_user }}' PGPASSWORD=\"$POSTGRES_PASSWORD\" {{ pgdump }} | PGPASSWORD=\"$POSTGRES_PASSWORD\" {{ pg_restore }} + psql -c 'REVOKE postgres FROM {{ awx_postgres_user }}' set +e +o pipefail echo 'Successful' "