mirror of
https://gitea.0xace.cc/ansible-galaxy/haproxy.git
synced 2025-06-29 01:43:06 +00:00
initial commit
This commit is contained in:
67
templates/haproxy.cfg.j2
Normal file
67
templates/haproxy.cfg.j2
Normal file
@ -0,0 +1,67 @@
|
||||
{% set haproxy_config = haproxy_combined_config %}
|
||||
global
|
||||
{% for key, value in haproxy_config.global.items() %}
|
||||
{% if value | type_debug != 'list' %}
|
||||
{{ key }} {{ value }}
|
||||
{% else %}
|
||||
{% for list_value in value %}
|
||||
{{ key }} {{ list_value }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
defaults
|
||||
{% for key, value in haproxy_config.defaults.items() %}
|
||||
{% if value | type_debug != 'list' %}
|
||||
{{ key }} {{ value }}
|
||||
{% else %}
|
||||
{% for list_value in value %}
|
||||
{{ key }} {{ list_value }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if haproxy_config.frontend is defined %}
|
||||
{% for frontend in haproxy_config.frontend %}
|
||||
frontend {{ frontend }}
|
||||
{% for key, value in haproxy_config.frontend[frontend].items() %}
|
||||
{% if value | type_debug != 'list' %}
|
||||
{{ key }} {{ value }}
|
||||
{% else %}
|
||||
{% for list_value in value %}
|
||||
{{ key }} {{ list_value }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if haproxy_config.backend is defined %}
|
||||
{% for backend in haproxy_config.backend %}
|
||||
backend {{ backend }}
|
||||
{% for key, value in haproxy_config.backend[backend].items() %}
|
||||
{% if value | type_debug != 'list' %}
|
||||
{{ key }} {{ value }}
|
||||
{% else %}
|
||||
{% for list_value in value %}
|
||||
{{ key }} {{ list_value }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if haproxy_config.listen is defined %}
|
||||
{% for listen in haproxy_config.listen %}
|
||||
listen {{ listen }}
|
||||
{% for key, value in haproxy_config.listen[listen].items() %}
|
||||
{% if value | type_debug != 'list' %}
|
||||
{{ key }} {{ value }}
|
||||
{% else %}
|
||||
{% for list_value in value %}
|
||||
{{ key }} {{ list_value }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
Reference in New Issue
Block a user