Skip to content

Commit

Permalink
Merge pull request #79 from akowalik-transporeon/master
Browse files Browse the repository at this point in the history
Adding option to set global toggles.
  • Loading branch information
goldyfruit authored Jun 14, 2024
2 parents 553b5c4 + 255b3f5 commit 4ff3612
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ haproxy_global_logs:
haproxy_global_tunes:
- tune.ssl.default-dh-param: 2048
# haproxy_global_server_state_base: current
# haproxy_global_toggles: []

# Default
haproxy_default_logs:
Expand Down
35 changes: 20 additions & 15 deletions templates/etc/haproxy/haproxy-global.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# GLOBAL #
##########################
global
{% if haproxy_global_chroot is defined and haproxy_global_chroot|length %}
{% if haproxy_global_chroot is defined and haproxy_global_chroot | length %}
chroot {{ haproxy_global_chroot | default('/var/lib/haproxy') }}
{% endif %}
{% if haproxy_global_daemon %}
Expand All @@ -26,50 +26,50 @@ global
{% endif %}
maxconn {{ haproxy_global_maxconn | default('4000') }}
pidfile {{ haproxy_global_pidfile | default('/var/run/haproxy.pid') }}
{% if haproxy_global_ca_base is defined and haproxy_global_ca_base|length %}
{% if haproxy_global_ca_base is defined and haproxy_global_ca_base | length %}
ca-base {{ haproxy_global_ca_base }}
{% endif %}
{% if haproxy_global_crt_base is defined and haproxy_global_crt_base|length %}
{% if haproxy_global_crt_base is defined and haproxy_global_crt_base | length %}
crt-base {{ haproxy_global_crt_base }}
{% endif %}
{% if haproxy_global_ssl_bind_options is defined and haproxy_global_ssl_bind_options|length %}
{% if haproxy_global_ssl_bind_options is defined and haproxy_global_ssl_bind_options | length %}
ssl-default-bind-options {{ haproxy_global_ssl_bind_options }}
{% endif %}
{% if haproxy_global_ssl_bind_ciphers is defined and haproxy_global_ssl_bind_ciphers|length %}
{% if haproxy_global_ssl_bind_ciphers is defined and haproxy_global_ssl_bind_ciphers | length %}
ssl-default-bind-ciphers {{ haproxy_global_ssl_bind_ciphers }}
{% endif %}
{% if haproxy_global_ssl_bind_ciphersuites is defined and haproxy_global_ssl_bind_ciphersuites|length %}
{% if haproxy_global_ssl_bind_ciphersuites is defined and haproxy_global_ssl_bind_ciphersuites | length %}
ssl-default-bind-ciphersuites {{ haproxy_global_ssl_bind_ciphersuites }}
{% endif %}
{% if haproxy_global_ssl_server_options is defined and haproxy_global_ssl_server_options|length %}
{% if haproxy_global_ssl_server_options is defined and haproxy_global_ssl_server_options | length %}
ssl-default-server-options {{ haproxy_global_ssl_server_options }}
{% endif %}
{% if haproxy_global_ssl_server_ciphers is defined and haproxy_global_ssl_server_ciphers|length %}
{% if haproxy_global_ssl_server_ciphers is defined and haproxy_global_ssl_server_ciphers | length %}
ssl-default-server-ciphers {{ haproxy_global_ssl_server_ciphers }}
{% endif %}
{% if haproxy_global_ssl_server_ciphersuites is defined and haproxy_global_ssl_server_ciphersuites|length %}
{% if haproxy_global_ssl_server_ciphersuites is defined and haproxy_global_ssl_server_ciphersuites | length %}
ssl-default-server-ciphersuites {{ haproxy_global_ssl_server_ciphersuites }}
{% endif %}
{% if haproxy_global_ssl_server_verify is defined and haproxy_global_ssl_server_verify|length %}
{% if haproxy_global_ssl_server_verify is defined and haproxy_global_ssl_server_verify | length %}
ssl-server-verify {{ haproxy_global_ssl_server_verify }}
{% endif %}
{% if haproxy_global_stats is defined and haproxy_global_stats|length %}
{% if haproxy_global_stats is defined and haproxy_global_stats | length %}
{% for stat in haproxy_global_stats %}
stats {{ stat }}
{% endfor %}
{% endif %}
{% if haproxy_global_description is defined and haproxy_global_description|length %}
{% if haproxy_global_description is defined and haproxy_global_description | length %}
description {{ haproxy_global_description }}
{% endif %}
{% if haproxy_global_ulimit_n is defined and haproxy_global_ulimit_n > 0 %}
ulimit-n {{ haproxy_global_ulimit_n }}
{% endif %}
{% if haproxy_global_logs is defined and haproxy_global_logs|length %}
{% if haproxy_global_logs is defined and haproxy_global_logs | length %}
{% for log in haproxy_global_logs %}
log {{ log }}
{% endfor %}
{% endif %}
{% if haproxy_global_tunes is defined and haproxy_global_tunes|length %}
{% if haproxy_global_tunes is defined and haproxy_global_tunes | length %}
{% for tune in haproxy_global_tunes %}
{% for key, value in tune.items() %}
{{ key }} {{ value }}
Expand All @@ -78,4 +78,9 @@ global
{% endif %}
{% if haproxy_global_server_state_base is defined %}
server-state-base {{ haproxy_global_server_state_base }}
{% endif %}
{% endif %}
{% if haproxy_global_toggles is defined and haproxy_global_toggles | length %}
{% for toggle in haproxy_global_toggles %}
{{ toggle }}
{% endfor %}
{% endif %}

0 comments on commit 4ff3612

Please sign in to comment.