Skip to content

Commit 354bdd9

Browse files
staaldraadhunleyd
andcommitted
Apply suggestion from @hunleyd
Co-authored-by: Douglas J Hunley <doug.hunley@gmail.com>
1 parent c3c64db commit 354bdd9

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

ansible/tasks/stage2-setup-postgres.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,23 +147,24 @@
147147
path: '/var/lib/postgresql/.nix-profile/bin/'
148148
register: 'nix_links'
149149

150-
- name: Check psql_version and install gatekeeper if not pg15
150+
- name: Check if psql_version is psql_15
151+
set_fact:
152+
is_psql_15: "{{ psql_version == 'psql_15' }}"
153+
154+
- name: Install gatekeeper if not pg15
155+
when:
156+
- stage2_nix
157+
- not is_pgsql_15
151158
block:
152-
- name: Check if psql_version is psql_15
153-
set_fact:
154-
is_psql_15: "{{ psql_version == 'psql_15' }}"
155-
156-
- name: Install gatekeeper from nix binary cache
159+
- name: Install gatekeeper from nix binary cache
157160
become: yes
158161
shell: |
159162
sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#gatekeeper"
160-
when: stage2_nix and not is_psql_15
161163
162164
- name: Create symbolic link for linux-pam to find pam_jit_pg.so
163165
shell: >
164166
sudo ln -s /var/lib/postgresql/.nix-profile/lib/security/pam_jit_pg.so $(find /nix/store -type d -path "/nix/store/*-linux-pam-*/lib/security" -print -quit)/pam_jit_pg.so
165167
become: yes
166-
when: stage2_nix and not is_psql_15
167168

168169
- name: Create symlinks for Nix files into /usr/lib/postgresql/bin
169170
ansible.builtin.file:

0 commit comments

Comments
 (0)