Skip to content

Commit ae9ceae

Browse files
committed
fix: block
1 parent 601906c commit ae9ceae

File tree

2 files changed

+32
-28
lines changed

2 files changed

+32
-28
lines changed

ansible/tasks/setup-postgres.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -175,18 +175,20 @@
175175
group: 'postgres'
176176
src: 'files/postgresql_config/conf.d/read_replica.conf'
177177

178-
- name: Check if psql_version is psql_15
179-
set_fact:
180-
is_psql_15: "{{ psql_version in ['psql_15'] }}"
181-
182-
- name: create placeholder pam config
183-
file:
184-
path: '/etc/pam.d/postgresql'
185-
state: touch
186-
owner: postgres
187-
group: postgres
188-
mode: 0664
189-
when: not is_psql_15
178+
- name: configure pam
179+
block:
180+
- name: Check if psql_version is psql_15
181+
ansible.builtin.set_fact:
182+
is_psql_15: "{{ psql_version in ['psql_15'] }}"
183+
184+
- name: create placeholder pam config
185+
file:
186+
path: '/etc/pam.d/postgresql'
187+
state: touch
188+
owner: postgres
189+
group: postgres
190+
mode: 0664
191+
when: not is_psql_15
190192

191193
# Install extensions before init
192194
- name: Install Postgres extensions

ansible/tasks/stage2-setup-postgres.yml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -155,24 +155,26 @@
155155
path: '/var/lib/postgresql/.nix-profile/bin/'
156156
register: 'nix_links'
157157

158-
- name: Check if psql_version is psql_15
159-
set_fact:
160-
is_psql_15: "{{ psql_version == 'psql_15' }}"
161-
162-
- name: Install gatekeeper if not pg15
163-
when:
164-
- stage2_nix
165-
- not is_psql_15
158+
- name: setup gatekeeper
166159
block:
167-
- name: Install gatekeeper from nix binary cache
168-
become: yes
169-
shell: |
170-
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+
- name: Check if psql_version is psql_15
161+
ansible.builtin.set_fact:
162+
is_psql_15: "{{ psql_version == 'psql_15' }}"
171163

172-
- name: Create symbolic link for linux-pam to find pam_jit_pg.so
173-
become: yes
174-
shell: |
175-
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
164+
- name: Install gatekeeper if not pg15
165+
when:
166+
- stage2_nix
167+
- not is_psql_15
168+
block:
169+
- name: Install gatekeeper from nix binary cache
170+
become: yes
171+
shell: |
172+
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"
173+
174+
- name: Create symbolic link for linux-pam to find pam_jit_pg.so
175+
become: yes
176+
shell: |
177+
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
176178
177179
- name: Create symlinks for Nix files into /usr/lib/postgresql/bin
178180
ansible.builtin.file:

0 commit comments

Comments
 (0)