Skip to content

Commit 34dcf3b

Browse files
committed
chore: Update PostgreSQL initdb for Nix
This commit updates the Ansible tasks for setting up PostgreSQL. The primary changes involve: - Shifting the `initdb` executable path from `/usr/lib/postgresql/bin/pg_ctl` to `/var/lib/postgresql/.nix-profile/bin/initdb`, reflecting a Nix-based installation. - Adjusting the arguments passed to `initdb` for clarity and correctness. - Updating the `creates` path in the Ansible `args` to match the new data directory structure.
1 parent 9be0668 commit 34dcf3b

File tree

1 file changed

+17
-21
lines changed

1 file changed

+17
-21
lines changed

ansible/tasks/setup-postgres.yml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -252,14 +252,13 @@
252252
become_user: 'postgres'
253253
ansible.builtin.command:
254254
argv:
255-
- /usr/lib/postgresql/bin/pg_ctl
255+
- /var/lib/postgresql/.nix-profile/bin/initdb
256256
- -D /var/lib/postgresql/data
257-
- initdb
258-
- -o "--allow-group-access"
259-
- -o "--username=supabase_admin"
260-
- -o "-D /data/pgdata"
257+
- --allow-group-access
258+
- --username=supabase_admin
259+
- -D /data/pgdata
261260
args:
262-
creates: /data/pgdata/PG_VERSION
261+
creates: /var/lib/postgresql/data/PG_VERSION
263262
vars:
264263
ansible_command_timeout: 60
265264
when:
@@ -288,14 +287,13 @@
288287
become_user: 'postgres'
289288
ansible.builtin.command:
290289
argv:
291-
- /usr/lib/postgresql/bin/pg_ctl
290+
- /var/lib/postgresql/.nix-profile/bin/initdb
292291
- -D /var/lib/postgresql/data
293-
- initdb
294-
- -o "--allow-group-access"
295-
- -o "--username=supabase_admin"
296-
- -o "-D /data/pgdata"
292+
- --allow-group-access
293+
- --username=supabase_admin
294+
- -D /data/pgdata
297295
args:
298-
creates: /data/pgdata/PG_VERSION
296+
creates: /var/lib/postgresql/data/PG_VERSION
299297
environment:
300298
LANG: en_US.UTF-8
301299
LANGUAGE: en_US.UTF-8
@@ -313,17 +311,15 @@
313311
become_user: 'postgres'
314312
ansible.builtin.command:
315313
argv:
316-
- /usr/lib/postgresql/bin/pg_ctl
314+
- /var/lib/postgresql/.nix-profile/bin/initdb
317315
- -D /var/lib/postgresql/data
318-
- initdb
319-
- -o "--allow-group-access"
320-
- -o "--username=supabase_admin"
321-
- -o "--locale-provider=icu"
322-
- -o "--encoding=UTF-8"
323-
- -o "--icu-locale=en_US.UTF-8"
324-
- -o "-D /data/pgdata"
316+
- --allow-group-access
317+
- --username=supabase_admin
318+
- --locale-provider=icu
319+
- --encoding=UTF-8
320+
- --icu-locale=en_US.UTF-8
325321
args:
326-
creates: /data/pgdata/PG_VERSION
322+
creates: /var/lib/postgresql/data/PG_VERSION
327323
environment:
328324
LANG: en_US.UTF-8
329325
LANGUAGE: en_US.UTF-8

0 commit comments

Comments
 (0)