I was reading this section of HAproxy configuration, and it seems that we can access variables by this syntax:-
monitor fail if { var(proc.stopping) -m int gt 0 }
I’m setting a variable in global section
as:-
set-var proc.location_admin_healthcheck_map str("./admin.map")
But, I’m unable to access that in frontend section
as:-
acl is_good str(status),map(var(proc.location_admin_healthcheck_map)) -i -m str GOOD
The error I get is:-
[ALERT] (10321) : config : parsing [haproxy.cfg:20] : error detected while parsing ACL 'is_good' : invalid args in converter 'map' : failed to open pattern file <var(proc.location_admin_healthcheck_map> in ACL expression 'str(status),map(var(proc.location_admin_healthcheck_map))'.
failed to open pattern file <var(proc.location_admin_healthcheck_map>
means the variable expansion never worked. What am I missing?