File tree Expand file tree Collapse file tree 2 files changed +52
-17
lines changed Expand file tree Collapse file tree 2 files changed +52
-17
lines changed Original file line number Diff line number Diff line change 204
204
ansible_command_timeout : 60
205
205
when : debpkg_mode
206
206
207
- - name : Initialize the database stage2_nix
208
- become : yes
209
- become_user : postgres
210
- shell : source /var/lib/postgresql/.bashrc && /usr/lib/postgresql/bin/pg_ctl -D /var/lib/postgresql/data initdb -o "--allow-group-access" -o "--username=supabase_admin"
211
- args :
212
- executable : /bin/bash
213
- environment :
214
- LANG : en_US.UTF-8
215
- LANGUAGE : en_US.UTF-8
216
- LC_ALL : en_US.UTF-8
217
- LC_CTYPE : en_US.UTF-8
218
- LOCALE_ARCHIVE : /usr/lib/locale/locale-archive
219
- vars :
220
- ansible_command_timeout : 60
221
- # Circumvents the following error:
222
- # "Timeout (12s) waiting for privilege escalation prompt"
223
- when : stage2_nix
207
+ - name : Check psql_version and modify supautils.conf and postgresql.conf if necessary
208
+ block :
209
+ - name : Check if psql_version is psql_orioledb
210
+ set_fact :
211
+ is_psql_oriole : " {{ psql_version in ['psql_orioledb-16', 'psql_orioledb-17'] }}"
212
+
213
+ - name : Initialize the database stage2_nix (non-orioledb)
214
+ become : yes
215
+ become_user : postgres
216
+ shell : source /var/lib/postgresql/.bashrc && /usr/lib/postgresql/bin/pg_ctl -D /var/lib/postgresql/data initdb -o "--allow-group-access" -o "--username=supabase_admin"
217
+ args :
218
+ executable : /bin/bash
219
+ environment :
220
+ LANG : en_US.UTF-8
221
+ LANGUAGE : en_US.UTF-8
222
+ LC_ALL : en_US.UTF-8
223
+ LC_CTYPE : en_US.UTF-8
224
+ LOCALE_ARCHIVE : /usr/lib/locale/locale-archive
225
+ vars :
226
+ ansible_command_timeout : 60
227
+ when : stage2_nix and not is_psql_oriole
228
+
229
+ - name : Initialize the database stage2_nix (orioledb)
230
+ become : yes
231
+ become_user : postgres
232
+ shell : source /var/lib/postgresql/.bashrc && /usr/lib/postgresql/bin/pg_ctl -D /var/lib/postgresql/data initdb -o "--allow-group-access" -o "--username=supabase_admin" -o "--locale-provider=icu" -o "--encoding=UTF-8" -o "--icu-locale=en_US.UTF-8"
233
+ args :
234
+ executable : /bin/bash
235
+ environment :
236
+ LANG : en_US.UTF-8
237
+ LANGUAGE : en_US.UTF-8
238
+ LC_ALL : en_US.UTF-8
239
+ LC_CTYPE : en_US.UTF-8
240
+ LOCALE_ARCHIVE : /usr/lib/locale/locale-archive
241
+ vars :
242
+ ansible_command_timeout : 60
243
+ when : stage2_nix and is_psql_oriole
224
244
225
245
- name : copy PG systemd unit
226
246
template :
Original file line number Diff line number Diff line change 25
25
/etc/postgresql-custom/supautils.conf
26
26
when : is_psql_oriole and stage2_nix
27
27
become : yes
28
+
28
29
- name : Remove db_user_namespace from postgresql.conf if oriole-xx build
29
30
ansible.builtin.command :
30
31
cmd : >
31
32
sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;'
32
33
/etc/postgresql/postgresql.conf
33
34
when : is_psql_oriole and stage2_nix
34
35
become : yes
36
+
35
37
- name : Append orioledb to shared_preload_libraries append within closing quote
36
38
ansible.builtin.command :
37
39
cmd : >
38
40
sed -i 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/'
39
41
/etc/postgresql/postgresql.conf
40
42
when : is_psql_oriole and stage2_nix
41
43
become : yes
44
+
42
45
- name : Add default_table_access_method setting
43
46
ansible.builtin.lineinfile :
44
47
path : /etc/postgresql/postgresql.conf
47
50
when : is_psql_oriole and stage2_nix
48
51
become : yes
49
52
53
+ - name : Add ICU locale settings
54
+ ansible.builtin.lineinfile :
55
+ path : /etc/postgresql/postgresql.conf
56
+ line : " {{ item }}"
57
+ state : present
58
+ with_items :
59
+ - " lc_collate = 'en-US-x-icu'"
60
+ - " lc_ctype = 'en-US-x-icu'"
61
+ - " icu_locale = 'en-US'"
62
+ when : is_psql_oriole and stage2_nix
63
+ become : yes
64
+
50
65
- name : Install Git for Nix package management
51
66
become : yes
52
67
apt :
You can’t perform that action at this time.
0 commit comments