Skip to content

Commit

Permalink
roles: haproxy: optional log-format
Browse files Browse the repository at this point in the history
  • Loading branch information
jimnydev committed Jul 3, 2024
1 parent ba3ae19 commit ade4765
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions roles/haproxy/templates/haproxy.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ listen master
maxconn {{ haproxy_maxconn.master }}
option tcplog
option httpchk OPTIONS /primary
{% if haproxy_log_format is defined %}
log-format '{{ haproxy_log_format }}'
{% endif%}
http-check expect status 200
default-server inter 3s fastinter 1s fall 3 rise 4 on-marked-down shutdown-sessions
{% if pgbouncer_install|bool %}
Expand All @@ -57,6 +60,9 @@ listen master_direct
maxconn {{ haproxy_maxconn.master }}
option tcplog
option httpchk OPTIONS /primary
{% if haproxy_log_format is defined %}
log-format '{{ haproxy_log_format }}'
{% endif%}
http-check expect status 200
default-server inter 3s fastinter 1s fall 3 rise 4 on-marked-down shutdown-sessions
{% for host in groups['postgres_cluster'] %}
Expand All @@ -77,6 +83,9 @@ listen replicas
{% else %}
option httpchk OPTIONS /replica?lag={{ patroni_maximum_lag_on_replica }}
{% endif %}
{% if haproxy_log_format is defined %}
log-format '{{ haproxy_log_format }}'
{% endif%}
balance roundrobin
http-check expect status 200
default-server inter 3s fastinter 1s fall 3 rise 2 on-marked-down shutdown-sessions
Expand Down Expand Up @@ -105,6 +114,9 @@ listen replicas_direct
{% else %}
option httpchk OPTIONS /replica?lag={{ patroni_maximum_lag_on_replica }}
{% endif %}
{% if haproxy_log_format is defined %}
log-format '{{ haproxy_log_format }}'
{% endif%}
balance roundrobin
http-check expect status 200
default-server inter 3s fastinter 1s fall 3 rise 2 on-marked-down shutdown-sessions
Expand All @@ -126,6 +138,9 @@ listen replicas_sync
{% else %}
option httpchk OPTIONS /sync
{% endif %}
{% if haproxy_log_format is defined %}
log-format '{{ haproxy_log_format }}'
{% endif%}
balance roundrobin
http-check expect status 200
default-server inter 3s fastinter 1s fall 3 rise 2 on-marked-down shutdown-sessions
Expand Down Expand Up @@ -154,6 +169,9 @@ listen replicas_sync_direct
{% else %}
option httpchk OPTIONS /sync
{% endif %}
{% if haproxy_log_format is defined %}
log-format '{{ haproxy_log_format }}'
{% endif%}
balance roundrobin
http-check expect status 200
default-server inter 3s fastinter 1s fall 3 rise 2 on-marked-down shutdown-sessions
Expand All @@ -175,6 +193,9 @@ listen replicas_async
{% else %}
option httpchk OPTIONS /async?lag={{ patroni_maximum_lag_on_replica }}
{% endif %}
{% if haproxy_log_format is defined %}
log-format '{{ haproxy_log_format }}'
{% endif%}
balance roundrobin
http-check expect status 200
default-server inter 3s fastinter 1s fall 3 rise 2 on-marked-down shutdown-sessions
Expand Down Expand Up @@ -203,6 +224,9 @@ listen replicas_async_direct
{% else %}
option httpchk OPTIONS /async?lag={{ patroni_maximum_lag_on_replica }}
{% endif %}
{% if haproxy_log_format is defined %}
log-format '{{ haproxy_log_format }}'
{% endif%}
balance roundrobin
http-check expect status 200
default-server inter 3s fastinter 1s fall 3 rise 2 on-marked-down shutdown-sessions
Expand Down

0 comments on commit ade4765

Please sign in to comment.