Skip to content

Commit e227d78

Browse files
committed
ansible: Simplify stage2 postgres install/setup
Don't need sudo -u postgres just to get the paths and no need to source nix-daemon.sh explicitly.
1 parent 86aa5ea commit e227d78

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

ansible/tasks/stage2-setup-postgres.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,14 @@
6262
when: stage2
6363
become: true
6464
block:
65-
- name: Resolve postgres env store path
65+
- name: Resolve postgres env from nix binary cache
6666
ansible.builtin.shell: |
67-
sudo -u postgres bash -c "
68-
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh &&
69-
nix build --no-link --print-out-paths github:supabase/postgres/{{ git_commit_sha }}#postgres-env-{{ postgresql_major_version }}
70-
"
67+
nix build --no-link --print-out-paths github:supabase/postgres/{{ git_commit_sha }}#postgres-env-{{ postgresql_major_version }}
7168
register: postgres_env_path
7269

7370
- name: Install postgres env from nix binary cache
7471
ansible.builtin.shell: |
75-
sudo -u postgres bash -c "
76-
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh &&
77-
nix-env --set {{ postgres_env_path.stdout }}
78-
"
72+
sudo -u postgres bash -c 'nix-env --set {{ postgres_env_path.stdout }}'
7973
8074
- name: Set ownership and permissions for file and dirs
8175
ansible.builtin.file:

0 commit comments

Comments
 (0)