Merge "Adding HAProxy backend options" into stable/ocata

This commit is contained in:
Jenkins 2017-05-15 14:37:04 +00:00 committed by Gerrit Code Review
commit 32dddb7ff5
3 changed files with 16 additions and 6 deletions

View File

@ -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_arguments:
- 'http-check expect string OK'

View File

@ -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.

View File

@ -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 }}