8000 more consolidation of pgbouncer tasks · michelp/postgres@a0bf9ae · GitHub
[go: up one dir, main page]

Skip to content

Commit a0bf9ae

Browse files
committed
more consolidation of pgbouncer tasks
1 parent d46af0e commit a0bf9ae

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

ansible/tasks/setup-pgbouncer.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@
5656
state: touch
5757
group: postgres
5858
owner: postgres
59+
60+
- name: import /etc/tmpfiles.d/pgbouncer.conf
61+
template:
62+
src: files/pgbouncer_config/tmpfiles.d-pgbouncer.conf.j2
63+
dest: /etc/tmpfiles.d/pgbouncer.conf
64+
become: yes
5965

6066
- name: PgBouncer - add permissions for pgbouncer user
6167
become: yes
@@ -67,12 +73,18 @@
6773
with_items:
6874
- "host all pgbouncer 127.0.0.1/32 md5"
6975
- "# Allow connection by pgbouncer user"
70-
71-
- name: import /etc/tmpfiles.d/pgbouncer.conf
72-
template:
73-
src: files/pgbouncer_config/tmpfiles.d-pgbouncer.conf.j2
74-
dest: /etc/tmpfiles.d/pgbouncer.conf
76+
77+
# Run PgBouncer SQL script
78+
- name: Transfer init SQL files
79+
copy:
80+
src: files/pgbouncer_config/pgbouncer_auth_schema.sql
81+
dest: /tmp/00-schema.sql
82+
83+
- name: Execute init SQL files
7584
become: yes
85+
become_user: postgres
86+
shell:
87+
cmd: /usr/lib/postgresql/bin/psql -f /tmp/00-schema.sql
7688

7789
# Add fail2ban filter
7890
- name: import jail.d/pgbouncer.conf

0 commit comments

Comments
 (0)
0