pbbouncer: minor fixes

This commit is contained in:
Jérémy Lecour 2023-06-01 09:43:20 +02:00 committed by Jérémy Lecour
parent 5027151011
commit 318991fe42
5 changed files with 18 additions and 7 deletions

View File

@ -22,6 +22,7 @@ The **patch** part changes is incremented if multiple releases happen the same m
* elasticsearch: improve networking configuration
* evolinux-users: remove Stretch references in tasks that also apply to next Debian versions
* mysql: improve shell syntax for mysql_skip script
* pbbouncer: minor fixes
### Fixed

View File

@ -32,9 +32,13 @@ pgbouncer_account_list:
- { name: "account2", hash: "<hash>" }
```
The value of `hash` can be obtained by running this command on the PostgreSQL server: `select passwd from pg_shadow where usename='account1';`
The value of `hash` can be obtained by running this command on the PostgreSQL server:
> These accounts must exist on the PostegreSQL server.
```
select passwd from pg_shadow where usename='account1';
```
> These accounts must exist on the PostgreSQL server.
The variables `pgbouncer_admin_users` and `pgbouncer_stats_users` list the SQL user can be access on pgbouncer console. This variables can be defines like this :

View File

@ -1,13 +1,18 @@
---
pgbouncer_listen_addr: "127.0.0.1"
pgbouncer_listen_addr:
- "127.0.0.1"
pgbouncer_listen_port: "6432"
# For PostgreSQL version < 14, use "md5"
# For PostgreSQL version >= 14, use "scram-sha-256"
pgbouncer_auth_type: "scram-sha-256"
# Each entry must have "name", "host" and "port" keys
pgbouncer_databases: []
pgbouncer_admin_users: []
pgbouncer_stats_users: []
# Each entry must have "name" and "hash" keys
pgbouncer_account_list: []

View File

@ -7,17 +7,18 @@
- name: Limit for PgBouncer is set
ansible.builtin.lineinfile:
path: /etc/default/pgbouncer
regexp: "ulimit -n"
line: ulimit -n 65536
notify: Restart PgBouncer
notify: restart pgbouncer
- name: Add config file for PgBouncer
ansible.builtin.template:
src: pgbouncer.ini.j2
dest: /etc/pgbouncer/pgbouncer.ini
notify: Restart PgBouncer
notify: restart pgbouncer
- name: Populate userlist.txt
ansible.builtin.template:
src: userlist.txt.j2
dest: /etc/pgbouncer/userlist.txt
notify: Restart PgBouncer
notify: restart pgbouncer

View File

@ -7,7 +7,7 @@
logfile = /var/log/postgresql/pgbouncer.log
pidfile = /var/run/postgresql/pgbouncer.pid
listen_addr = {{ pgbouncer_listen_addr }}
listen_addr = {{ pgbouncer_listen_addr | join(',') }}
listen_port = {{ pgbouncer_listen_port }}
unix_socket_dir =