Skip to content

Commit 5986492

Browse files
committed
chore: patch ansible playbook for psql_15
1 parent 54c0159 commit 5986492

File tree

1 file changed

+33
-23
lines changed

1 file changed

+33
-23
lines changed

ansible/tasks/setup-postgres.yml

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -138,30 +138,40 @@
138138
dest: /etc/postgresql/postgresql.conf
139139
group: postgres
140140
when: debpkg_mode or nixpkg_mode
141-
142-
# Add pg_hba.conf
143141
- name: import pg_hba.conf
144-
template:
145-
src: files/postgresql_config/pg_hba.conf.j2
146-
dest: /etc/postgresql/pg_hba.conf
147-
group: postgres
148-
when: debpkg_mode or nixpkg_mode
149-
150-
# Add pg_hba_public.conf
151-
- name: import pg_hba_public.conf
152-
template:
153-
src: files/postgresql_config/pg_hba_public.conf.j2
154-
dest: /etc/postgresql/pg_hba_public.conf
155-
group: postgres
156-
when: debpkg_mode or nixpkg_mode
157-
158-
# Add pg_hba_users_public.conf
159-
- name: import pg_hba_users_public.conf
160-
template:
161-
src: files/postgresql_config/pg_hba_users_public.conf.j2
162-
dest: /etc/postgresql/pg_hba_users_public.conf
163-
group: postgres
164-
when: debpkg_mode or nixpkg_mode
142+
block:
143+
- name: Check if psql_version is 15
144+
set_fact:
145+
is_psql_15: "{{ psql_version in ['psql_15'] }}"
146+
# Add pg_hba.conf
147+
- name: import pg_hba.conf psql_15
148+
template:
149+
src: files/postgresql_config/pg_hba.conf_15.j2
150+
dest: /etc/postgresql/pg_hba.conf
151+
group: postgres
152+
when: (debpkg_mode or nixpkg_mode) and is_psql_15
153+
- name: import pg_hba.conf
154+
template:
155+
src: files/postgresql_config/pg_hba.conf.j2
156+
dest: /etc/postgresql/pg_hba.conf
157+
group: postgres
158+
when: (debpkg_mode or nixpkg_mode) and not is_psql_15
159+
160+
# Add pg_hba_public.conf
161+
- name: import pg_hba_public.conf
162+
template:
163+
src: files/postgresql_config/pg_hba_public.conf.j2
164+
dest: /etc/postgresql/pg_hba_public.conf
165+
group: postgres
166+
when: (debpkg_mode or nixpkg_mode) and not is_psql_15
167+
168+
# Add pg_hba_users_public.conf
169+
- name: import pg_hba_users_public.conf
170+
template:
171+
src: files/postgresql_config/pg_hba_users_public.conf.j2
172+
dest: /etc/postgresql/pg_hba_users_public.conf
173+
group: postgres
174+
when: (debpkg_mode or nixpkg_mode) and not is_psql_15
165175

166176
# Add pg_ident.conf
167177
- name: import pg_ident.conf

0 commit comments

Comments
 (0)