Skip to content

Commit

Permalink
net/haproxy: add support for init-addr, fixes opnsense#1787
Browse files Browse the repository at this point in the history
  • Loading branch information
fraenki committed Aug 18, 2020
1 parent 89737eb commit 66608b9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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") %}
Expand Down

0 comments on commit 66608b9

Please sign in to comment.