Merge "Adding HAProxy backend options"
This commit is contained in:
commit
24189581b3
@ -6,12 +6,14 @@
|
||||
vars:
|
||||
haproxy_service_configs:
|
||||
- service:
|
||||
hap_service_name: group_name
|
||||
hap_backend_nodes: "{{ groups['group_name'][0] }}"
|
||||
hap_backup_nodes: "{{ groups['group_name'][1:] }}"
|
||||
hap_port: 80
|
||||
hap_balance_type: http
|
||||
hap_backend_options:
|
||||
haproxy_service_name: group_name
|
||||
haproxy_backend_nodes: "{{ groups['group_name'][0] }}"
|
||||
haproxy_backup_nodes: "{{ groups['group_name'][1:] }}"
|
||||
haproxy_port: 80
|
||||
haproxy_balance_type: http
|
||||
haproxy_backend_options:
|
||||
- "forwardfor"
|
||||
- "httpchk"
|
||||
- "httplog"
|
||||
haproxy_backend_aguments:
|
||||
- 'http-check expect string OK'
|
||||
|
@ -0,0 +1,4 @@
|
||||
---
|
||||
features:
|
||||
- The new option `haproxy_backend_arguments` can be utilized to add
|
||||
arbitrary options to a HAProxy backend like tcp-check or http-check.
|
@ -65,6 +65,7 @@ frontend {{ item.service.haproxy_service_name }}-front-{{ loop.index }}
|
||||
{% endfor %}
|
||||
|
||||
{% set backend_options = item.service.haproxy_backend_options|default([]) %}
|
||||
{% set backend_arguments = item.service.haproxy_backend_arguments|default([]) %}
|
||||
|
||||
backend {{ item.service.haproxy_service_name }}-back
|
||||
mode {{ item.service.haproxy_balance_type }}
|
||||
@ -83,6 +84,9 @@ backend {{ item.service.haproxy_service_name }}-back
|
||||
{% for option in backend_options %}
|
||||
option {{ option }}
|
||||
{% endfor %}
|
||||
{% for argument in backend_arguments %}
|
||||
{{ argument }}
|
||||
{% endfor %}
|
||||
{% set backend_httpcheck_options = item.service.haproxy_backend_httpcheck_options|default([]) %}
|
||||
{% for option in backend_httpcheck_options %}
|
||||
http-check {{ option }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user