updated haproxy state
This commit is contained in:
parent
3aa818ade8
commit
0b25a888b1
@ -25,7 +25,9 @@ http-response return status 404 content-type text/html string "<h1>404 not found
|
||||
{%- macro httpendpoints(servers=[], check=True, disabled=False) -%}
|
||||
{%- if servers -%}
|
||||
{%- for server in servers %}
|
||||
{% if server.name in haproxy.servers.keys() -%}
|
||||
{% if "addr" in server.keys() -%}
|
||||
{%- set addr = server.addr -%}
|
||||
{%- elif server.name in haproxy.servers.keys() -%}
|
||||
{%- set addr = haproxy.servers[server.name][0] -%}
|
||||
{%- else -%}
|
||||
{%- set addr = server.name -%}
|
||||
@ -38,12 +40,14 @@ http-response return status 404 content-type text/html string "<h1>404 not found
|
||||
{%- macro tcpendpoints(servers=[], check=True) -%}
|
||||
{%- if servers -%}
|
||||
{%- for server in servers %}
|
||||
{% if server.name in haproxy.servers.keys() -%}
|
||||
{% if "addr" in server.keys() -%}
|
||||
{%- set addr = server.addr -%}
|
||||
{%- elif server.name in haproxy.servers.keys() -%}
|
||||
{%- set addr = haproxy.servers[server.name][0] -%}
|
||||
{%- else -%}
|
||||
{%- set addr = server.name -%}
|
||||
{%- endif -%}
|
||||
server {{ server.name }} {{ addr }}:{{ server.port }}{{ " check" if check }}{{ " backup" if server.backup|default(False) }} port {{ server.port }}{{ " on-marked-down shutdown-sessions on-marked-up shutdown-backup-sessions" if server.killsessions|default(False) }}
|
||||
server {{ server.name }} {{ addr }}:{{ server.port }}{{ " check" if check }}{{ " backup" if server.backup|default(False) }} port {{ server.port }}{{ " on-marked-down shutdown-sessions" if server.killsessions|default(False) }}
|
||||
{%- endfor %}
|
||||
{%- endif -%}
|
||||
{%- endmacro -%}
|
||||
@ -290,6 +294,8 @@ listen {{ name }} from {{ haproxy.config.namespace }}
|
||||
mode tcp
|
||||
option tcplog
|
||||
option tcpka
|
||||
stick-table type ip size 10k peers paulbsd
|
||||
stick on dst
|
||||
{%- if values.type == "postgres" %}
|
||||
option pgsql-check user repmgr
|
||||
{%- endif %}
|
||||
|
Loading…
Reference in New Issue
Block a user