Skip to content

Commit 0d7c78c

Browse files
committed
fix(setup-postgres): we don't need to read .bashrc as the vars in it are already set in the env: statement
1 parent 4ccff9c commit 0d7c78c

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

ansible/tasks/setup-postgres.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -234,15 +234,6 @@
234234
is_psql_17: "{{ psql_version in ['psql_17'] }}"
235235
is_psql_oriole: "{{ psql_version in ['psql_orioledb-17'] }}"
236236

237-
- name: Load /var/lib/postgresql/.bashrc into env vars for later use
238-
ansible.builtin.slurp:
239-
src: '/var/lib/postgresql/.bashrc'
240-
register: 'pg_bashrc_contents'
241-
242-
- name: Push .bashrc into facts
243-
ansible.builtin.set_fact:
244-
bashrc_vars: "{{ ('{' + (pg_bashrc_contents['content'] | b64decode).split('\n') | select | map('regex_replace', '([^=]*)=(.*)', '\"\\1\": \"\\2\"') | join(',') + '}') | from_json }}"
245-
246237
- name: Initialize the database stage2_nix (non-orioledb)
247238
become: true
248239
become_user: 'postgres'
@@ -254,7 +245,6 @@
254245
- -o "--allow-group-access"
255246
- -o "--username=supabase_admin"
256247
environment:
257-
"{{ bashrc_vars }}"
258248
LANG: en_US.UTF-8
259249
LANGUAGE: en_US.UTF-8
260250
LC_ALL: en_US.UTF-8
@@ -279,7 +269,6 @@
279269
- -o "--encoding=UTF-8"
280270
- -o "--icu-locale=en_US.UTF-8"
281271
environment:
282-
"{{ bashrc_vars }}"
283272
LANG: en_US.UTF-8
284273
LANGUAGE: en_US.UTF-8
285274
LC_ALL: en_US.UTF-8
@@ -319,7 +308,6 @@
319308
ansible.builtin.command:
320309
cmd: '/usr/lib/postgresql/bin/pg_ctl -D /var/lib/postgresql/data start'
321310
environment:
322-
"{{ bashrc_vars }}"
323311
LANG: en_US.UTF-8
324312
LANGUAGE: en_US.UTF-8
325313
LC_ALL: en_US.UTF-8

0 commit comments

Comments
 (0)