net/haproxy: add support for init-addr, fixes #1787

This commit is contained in:
Frank Wall
2020-08-18 18:05:01 +02:00
parent 89737ebe2c
commit 66608b9dc9
3 changed files with 22 additions and 0 deletions
@@ -227,6 +227,14 @@
<type>dropdown</type>
<help><![CDATA[Enable or disable session redistribution in case of connection failure.]]></help>
</field>
<field>
<id>haproxy.general.defaults.init_addr</id>
<label>DNS Resolve Order</label>
<type>select_multiple</type>
<style>tokenize</style>
<sortable>true</sortable>
<help><![CDATA[Indicates in which order server addresses should be resolved upon startup. Method "last" suggests to pick the address which appears in the state file. Method "libc" uses the libc's internal resolver. Method "none" specifically indicates that the server should start without any valid IP address in a down state. It can be useful to ignore some DNS issues upon startup, waiting for the situation to get fixed later. Defaults to "last,libc".]]></help>
</field>
<field>
<id>haproxy.general.defaults.customOptions</id>
<label>Custom options</label>
@@ -199,6 +199,17 @@
<x-3>redispatch on the 3rd retry prior to the last retry</x-3>
</OptionValues>
</redispatch>
<init_addr type="OptionField">
<Required>N</Required>
<default>last,libc</default>
<Multiple>Y</Multiple>
<Sorted>Y</Sorted>
<OptionValues>
<last>last</last>
<libc>libc</libc>
<none>none</none>
</OptionValues>
</init_addr>
<customOptions type="TextField">
<Required>N</Required>
</customOptions>
@@ -933,6 +933,9 @@ defaults
{% if OPNsense.HAProxy.general.defaults.retries|default("") != "" %}
retries {{OPNsense.HAProxy.general.defaults.retries}}
{% endif %}
{% if OPNsense.HAProxy.general.defaults.init_addr|default("") != "" %}
default-server init-addr {{OPNsense.HAProxy.general.defaults.init_addr}}
{% endif %}
{% if OPNsense.HAProxy.general.defaults.customOptions|default("") != "" %}
# WARNING: pass through options below this line
{% for customOpt in OPNsense.HAProxy.general.defaults.customOptions.split("\n") %}