Skip to content

Commit

Permalink
Add postgresql_listen_addr variable
Browse files Browse the repository at this point in the history
  • Loading branch information
vitabaks committed Mar 12, 2024
1 parent 9b1f8d2 commit bb03984
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 1 addition & 5 deletions roles/patroni/templates/patroni.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,7 @@ bootstrap:


postgresql:
{% if not with_haproxy_load_balancing|bool and not pgbouncer_install|bool and (cluster_vip is defined and cluster_vip | length > 0) %}
listen: {{ inventory_hostname }},{{ cluster_vip }},127.0.0.1:{{ postgresql_port }}
{% else %}
listen: {{ inventory_hostname }},127.0.0.1:{{ postgresql_port }}
{% endif %}
listen: {{ postgresql_listen_addr }}:{{ postgresql_port }}
connect_address: {{ inventory_hostname }}:{{ postgresql_port }}
{% if patroni_superuser_username == 'postgres' %}
use_unix_socket: true
Expand Down
5 changes: 3 additions & 2 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ consul_services:
# PostgreSQL variables
postgresql_version: "16"
# postgresql_data_dir: see vars/Debian.yml or vars/RedHat.yml
postgresql_listen_addr: "0.0.0.0" # Listen on all interfaces. Or use "{{ inventory_hostname }},127.0.0.1" to listen on a specific IP address.
postgresql_port: "5432"
postgresql_encoding: "UTF8" # for bootstrap only (initdb)
postgresql_locale: "en_US.UTF-8" # for bootstrap only (initdb)
Expand Down Expand Up @@ -305,7 +306,7 @@ pgbouncer_install: true # or 'false' if you do not want to install and configur
pgbouncer_processes: 1 # Number of pgbouncer processes to be used. Multiple processes use the so_reuseport option for better performance.
pgbouncer_conf_dir: "/etc/pgbouncer"
pgbouncer_log_dir: "/var/log/pgbouncer"
pgbouncer_listen_addr: "0.0.0.0"
pgbouncer_listen_addr: "0.0.0.0" # Listen on all interfaces. Or use "{{ inventory_hostname }}" to listen on a specific IP address.
pgbouncer_listen_port: 6432
pgbouncer_max_client_conn: 10000
pgbouncer_max_db_connections: 1000
Expand Down Expand Up @@ -333,7 +334,7 @@ pgbouncer_pools:


# Extended variables (optional)
patroni_restapi_listen_addr: "0.0.0.0" # Listen on all interfaces. Use "{{ inventory_hostname }}" to listen on a specific IP address.
patroni_restapi_listen_addr: "0.0.0.0" # Listen on all interfaces. Or use "{{ inventory_hostname }}" to listen on a specific IP address.
patroni_restapi_port: 8008
patroni_ttl: 30
patroni_loop_wait: 10
Expand Down

0 comments on commit bb03984

Please sign in to comment.