Skip to content

Commit c35fa68

Browse files
committed
chore more oriole16 handling
1 parent a8f1a6b commit c35fa68

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

ansible/tasks/stage2-setup-postgres.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install nixpkgs#openjdk11"
55
# It was decided to leave pljava disabled at https://github.com/supabase/postgres/pull/690 therefore removing this task
66

7-
- name: Check psql_version and modify supautils.conf if necessary
7+
- name: Check psql_version and modify supautils.conf and postgresql.conf if necessary
88
block:
99
- name: Check if psql_version is psql_oriole-16
1010
set_fact:
@@ -25,6 +25,7 @@
2525
/etc/postgresql-custom/supautils.conf
2626
when: is_psql_oriole_16 and stage2_nix
2727
become: yes
28+
2829
- name: Install Postgres from nix binary cache
2930
become: yes
3031
shell: |
@@ -219,13 +220,19 @@
219220
recurse: yes
220221
when: stage2_nix
221222

222-
- name: Recursively create symbolic links and set permissions for the contrib/postgis-* dir
223-
shell: >
224-
sudo mkdir -p /usr/lib/postgresql/share/postgresql/contrib && \
225-
sudo find /var/lib/postgresql/.nix-profile/share/postgresql/contrib/ -mindepth 1 -type d -exec sh -c 'for dir do sudo ln -s "$dir" "/usr/lib/postgresql/share/postgresql/contrib/$(basename "$dir")"; done' sh {} + \
226-
&& chown -R postgres:postgres "/usr/lib/postgresql/share/postgresql/contrib/"
227-
become: yes
228-
when: stage2_nix
223+
- name: Check psql_version and run postgis linking if not oriole-16
224+
block:
225+
- name: Check if psql_version is psql_oriole-16
226+
set_fact:
227+
is_psql_oriole_16: "{{ psql_version == 'psql_oriole-16' }}"
228+
229+
- name: Recursively create symbolic links and set permissions for the contrib/postgis-* dir
230+
shell: >
231+
sudo mkdir -p /usr/lib/postgresql/share/postgresql/contrib && \
232+
sudo find /var/lib/postgresql/.nix-profile/share/postgresql/contrib/ -mindepth 1 -type d -exec sh -c 'for dir do sudo ln -s "$dir" "/usr/lib/postgresql/share/postgresql/contrib/$(basename "$dir")"; done' sh {} + \
233+
&& chown -R postgres:postgres "/usr/lib/postgresql/share/postgresql/contrib/"
234+
become: yes
235+
when: stage2_nix and not is_psql_oriole_16
229236

230237
- name: Create symbolic links from /var/lib/postgresql/.nix-profile/share/postgresql/timezonesets to /usr/lib/postgresql/share/postgresql/timeszonesets
231238
file:

0 commit comments

Comments
 (0)