Skip to content

Commit e4e5abf

Browse files
committed
chore: patch ansible playbook for psql_15
1 parent f7a6c48 commit e4e5abf

File tree

1 file changed

+30
-33
lines changed

1 file changed

+30
-33
lines changed

ansible/tasks/setup-postgres.yml

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -138,40 +138,37 @@
138138
dest: /etc/postgresql/postgresql.conf
139139
group: postgres
140140
when: debpkg_mode or nixpkg_mode
141+
142+
# Add pg_hba.conf
143+
- name: import pg_hba.conf psql_15
144+
template:
145+
src: files/postgresql_config/pg_hba.conf_15.j2
146+
dest: /etc/postgresql/pg_hba.conf
147+
group: postgres
148+
when: (debpkg_mode or nixpkg_mode) and (postgresql_major | int == 15)
149+
141150
- name: import pg_hba.conf
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
151+
template:
152+
src: files/postgresql_config/pg_hba.conf.j2
153+
dest: /etc/postgresql/pg_hba.conf
154+
group: postgres
155+
when: (debpkg_mode or nixpkg_mode) and (postgresql_major | int != 15)
156+
157+
# Add pg_hba_public.conf
158+
- name: import pg_hba_public.conf
159+
template:
160+
src: files/postgresql_config/pg_hba_public.conf.j2
161+
dest: /etc/postgresql/pg_hba_public.conf
162+
group: postgres
163+
when: (debpkg_mode or nixpkg_mode) and (postgresql_major | int != 15)
164+
165+
# Add pg_hba_users_public.conf
166+
- name: import pg_hba_users_public.conf
167+
template:
168+
src: files/postgresql_config/pg_hba_users_public.conf.j2
169+
dest: /etc/postgresql/pg_hba_users_public.conf
170+
group: postgres
171+
when: (debpkg_mode or nixpkg_mode) and (postgresql_major | int != 15)
175172

176173
# Add pg_ident.conf
177174
- name: import pg_ident.conf

0 commit comments

Comments
 (0)