Skip to content

Commit 785dcf2

Browse files
committed
feat: Symlink PostgreSQL config files
Symlinks PostgreSQL configuration files (`pg_hba.conf`, `pg_ident.conf`, `postgresql.conf`) from `/etc/postgresql/` into the PGDATA directory (`/var/lib/postgresql/data/`). This ensures that the configuration files within PGDATA are always managed centrally and point to the correct, actively used configuration. The `force: true` option is added to overwrite any existing files, guaranteeing the symlink is correctly established.
1 parent 6124db1 commit 785dcf2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ansible/tasks/setup-postgres.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,12 @@
322322
when:
323323
- (is_psql_oriole or is_psql_17)
324324

325-
- name: Remove extraneous configuration files
325+
- name: Symlink the conf files in PGDATA to the actually-in-use conf files
326326
ansible.builtin.file:
327+
force: true
327328
path: /var/lib/postgresql/data/{{ conf_item }}
328-
state: absent
329+
src: /etc/postgresql/{{ conf_item }}
330+
state: link
329331
loop:
330332
- pg_hba.conf
331333
- pg_ident.conf

0 commit comments

Comments
 (0)