hachyderm.general.pgbouncer role – Install and configure PgBouncer

Note

This role is part of the hachyderm.general collection (version 1.0.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it use: ansible-galaxy collection install hachyderm.general.

To use it in a playbook, specify: hachyderm.general.pgbouncer.

Entry point main – Install and configure PgBouncer

Synopsis

  • Install and configure PgBouncer, a lightweight connection pooler for PostgreSQL.

Parameters

Parameter

Comments

pgbouncer_admin_users

list / elements=string

List of database users that are allowed to connect and run all commands on the console.

See admin_users.

pgbouncer_auth_file

path

Path to the authentication file.

See auth_file.

Default: "/etc/pgbouncer/userlist.txt"

pgbouncer_auth_type

string

How to authenticate users.

See auth_type.

Default: "scram-sha-256"

pgbouncer_auth_users

dictionary

Dictionary of authentication settings used to create the authentication file.

The key is the username.

The value is the password hash.

pgbouncer_databases

dictionary

Dictionary of databases connections strings.

The key is the database name.

The value is the connection string.

See Section [databases].

pgbouncer_default_pool_size

integer

How many server connections to allow per user/database pair.

See default_pool_size.

Default: 20

pgbouncer_ignore_startup_parameters

list / elements=string

List of parameters to ignore in startup packets.

The list will be transformed to a coma separated list in the configuration file.

See ignore_startup_parameters.

pgbouncer_listen_addr

list / elements=string

List of addresses to listen.

See listen_addr.

Default: ["localhost"]

pgbouncer_listen_port

integer

Which port to listen on.

See listen_port.

Default: 6432

pgbouncer_logfile

path

Path to the log file.

See logfile.

Default: "/var/log/postgresql/pgbouncer.log"

pgbouncer_max_client_conn

integer

Maximum number of client connections allowed.

See max_client_conn.

Default: 100

pgbouncer_pidfile

path

Path to PID file.

See pidfile.

Default: "/var/run/postgresql/pgbouncer.pid"

pgbouncer_pool_mode

string

Specifies when a server connection can be reused by other clients.

See pool_mode.

Choices:

  • "session"

  • "transaction"

  • "statement"

pgbouncer_service_after

list / elements=string

List of systemd units to wait before starting the service.

pgbouncer_stats_users

list / elements=string

List of database users that are allowed to connect and run read-only queries on the console.

The list will be transformed to a coma separated list in the configuration file.

See stats_users.

pgbouncer_users

dictionary

Dictionary of users.

The key is the user name.

The value is the user settings.

See Section [users].

Authors

  • Hachyderm contributors