Hi HAproxy community,

There is a requirement to dynamically construct server/server-template
lines based on some variables.

*global section (dcname == us1) :- *
set-var proc.dcname env(dcname)

*Backend section:- *
# svcname.us1.discovery.com is a valid DNS record
server-template svcname 1-4 svcname.%[var(proc.dcname)].discovery.com

It looks like this isn't possible because in my testing, it doesn't
evaluate the var fetch while setting "server.hostname" from
server-template. This seems to be true for the "server" directive as well.

*Error with server block:- *
Config: server abc.def.%[var(proc.dcname)] 127.0.0.1:1234
Error: : character '%' is not permitted in server name
'abc.def.%[var(proc.dcname)]'

* Can someone point to the section in the configuration guide
<https://docs.haproxy.org/dev/configuration.html#7.3.2> which highlights
this limitation?
* Are sample fetches only available in specific blocks or directives? Is
there a general rule?

-- 
Cheers,
Abhijeet (https://abhi.host)

Reply via email to