Skip to content

Commit b208577

Browse files
authored
chore: add PG prestart script (#984)
1 parent 972c06c commit b208577

File tree

5 files changed

+21
-1
lines changed

5 files changed

+21
-1
lines changed

ansible/files/postgres_prestart.sh.j2

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
if [ $(cat /etc/locale.gen | grep -c en_US.UTF-8) -eq 0 ]; then
4+
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
5+
fi
6+
7+
if [ $(locale -a | grep -c en_US.utf8) -eq 0 ]; then
8+
locale-gen
9+
fi

ansible/files/postgresql_config/postgresql.service.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ After=database-optimizations.service
1010
Type=notify
1111
User=postgres
1212
ExecStart=/usr/lib/postgresql/bin/postgres -D /etc/postgresql
13+
ExecStartPre=+/usr/local/bin/postgres_prestart.sh
1314
ExecReload=/bin/kill -HUP $MAINPID
1415
KillMode=mixed
1516
KillSignal=SIGINT
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
- name: postgres_prestart - create service file
2+
template:
3+
src: files/postgres_prestart.sh.j2
4+
dest: /usr/local/bin/postgres_prestart.sh
5+
mode: a+x
6+
owner: root
7+
group: root

ansible/tasks/setup-supabase-internal.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,6 @@
106106

107107
- name: Install pg_egress_collect
108108
import_tasks: internal/pg_egress_collect.yml
109+
110+
- name: Install PostgreSQL prestart script
111+
import_tasks: internal/postgresql-prestart.yml

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.1.56"
1+
postgres-version = "15.1.1.57"

0 commit comments

Comments
 (0)