Skip to content

Commit

Permalink
pgbouncer: Add the pgbouncer_listen_addr variable
Browse files Browse the repository at this point in the history
Default value: 0.0.0.0

#219
  • Loading branch information
vitabaks committed Apr 22, 2023
1 parent f7b10df commit 55b0e98
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 1 addition & 5 deletions roles/pgbouncer/templates/pgbouncer.ini.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
[pgbouncer]
logfile = {{ pgbouncer_log_dir }}/pgbouncer.log
pidfile = /run/pgbouncer/pgbouncer.pid
{% if not with_haproxy_load_balancing|bool and cluster_vip is defined and cluster_vip | length > 0 %}
listen_addr = {{ hostvars[inventory_hostname]['inventory_hostname'] }},{{ cluster_vip }}
{% else %}
listen_addr = {{ hostvars[inventory_hostname]['inventory_hostname'] }}
{% endif %}
listen_addr = {{ pgbouncer_listen_addr | default('0.0.0.0') }}
listen_port = {{ pgbouncer_listen_port | default(6432) }}
unix_socket_dir = /var/run/postgresql
auth_type = {{ pgbouncer_auth_type }}
Expand Down
1 change: 1 addition & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ postgresql_pgpass:
pgbouncer_install: true # or 'false' if you do not want to install and configure the pgbouncer service
pgbouncer_conf_dir: "/etc/pgbouncer"
pgbouncer_log_dir: "/var/log/pgbouncer"
pgbouncer_listen_addr: "0.0.0.0"
pgbouncer_listen_port: 6432
pgbouncer_max_client_conn: 10000
pgbouncer_max_db_connections: 1000
Expand Down

0 comments on commit 55b0e98

Please sign in to comment.