|
183 | 183 | group: postgres |
184 | 184 | mode: 0664 |
185 | 185 | owner: postgres |
186 | | - path: '/etc/postgresql-custom/{{ item }}' |
| 186 | + path: '/etc/postgresql-custom/conf.d/{{ item }}' |
187 | 187 | state: touch |
188 | 188 | with_items: |
189 | 189 | - 'generated-optimizations.conf' |
190 | 190 | - 'custom-overrides.conf' |
191 | 191 |
|
192 | | - - name: import postgresql.conf |
193 | | - ansible.builtin.template: |
194 | | - dest: /etc/postgresql/postgresql.conf |
195 | | - group: postgres |
196 | | - src: files/postgresql_config/postgresql.conf.j2 |
197 | | - |
198 | | - - name: import pg_hba.conf |
199 | | - ansible.builtin.template: |
200 | | - dest: /etc/postgresql/pg_hba.conf |
201 | | - group: postgres |
202 | | - src: files/postgresql_config/pg_hba.conf.j2 |
203 | | - |
204 | | - - name: import pg_ident.conf |
| 192 | + - name: import postgresql.conf, pg_hba.conf, and pg_ident.conf |
205 | 193 | ansible.builtin.template: |
206 | | - dest: /etc/postgresql/pg_ident.conf |
| 194 | + dest: /etc/postgresql/{{ conf_item }} |
207 | 195 | group: postgres |
208 | | - src: files/postgresql_config/pg_ident.conf.j2 |
| 196 | + src: files/postgresql_config/{{ conf_item }}.j2 |
| 197 | + loop: |
| 198 | + - postgresql.conf |
| 199 | + - pg_hba.conf |
| 200 | + - pg_ident.conf |
| 201 | + loop_control: |
| 202 | + loop_var: conf_item |
209 | 203 |
|
210 | 204 | - name: Move custom read-replica.conf file to /etc/postgresql-custom/conf.d/read-replica.conf |
211 | 205 | ansible.builtin.copy: |
|
247 | 241 | src: '/data/pgdata' |
248 | 242 | state: 'link' |
249 | 243 |
|
| 244 | + - command: ls -ld /var/lib/postgresql/data |
| 245 | + register: pgdata |
| 246 | + - debug: |
| 247 | + msg: "{{ pgdata.stdout }}" |
250 | 248 | - name: Initialize the database |
251 | 249 | become: true |
252 | 250 | become_user: 'postgres' |
|
257 | 255 | - --allow-group-access |
258 | 256 | - --data-checksums |
259 | 257 | - --username=supabase_admin |
260 | | - - -D /data/pgdata |
261 | 258 | args: |
262 | 259 | creates: /var/lib/postgresql/data/PG_VERSION |
263 | 260 | vars: |
|
274 | 271 | when: |
275 | 272 | - nixpkg_mode |
276 | 273 |
|
277 | | -- name: Check psql_version and modify supautils.conf and postgresql.conf if necessary |
| 274 | +- name: Check psql_version and call initdb appropriately |
278 | 275 | when: |
279 | 276 | - stage2_nix |
280 | 277 | block: |
|
283 | 280 | is_psql_17: "{{ psql_version in ['psql_17'] }}" |
284 | 281 | is_psql_oriole: "{{ psql_version in ['psql_orioledb-17'] }}" |
285 | 282 |
|
| 283 | + - command: ls -ld /var/lib/postgresql/data |
| 284 | + register: pgdata |
| 285 | + - debug: |
| 286 | + msg: "{{ pgdata.stdout }}" |
286 | 287 | - name: Initialize the database stage2_nix (non-orioledb) |
287 | 288 | become: true |
288 | 289 | become_user: 'postgres' |
|
293 | 294 | - --allow-group-access |
294 | 295 | - --data-checksums |
295 | 296 | - --username=supabase_admin |
296 | | - - -D /data/pgdata |
297 | 297 | args: |
298 | 298 | creates: /var/lib/postgresql/data/PG_VERSION |
299 | 299 | environment: |
|
0 commit comments