Hi,
I'm trying to make the haproxy configuration more dynamic using
environment variables and while this works for the definition of the pid
file and the stats socket when I try to use an env. variable as the port
of a peer definition I get an error:
peers lb1-peers
peer haproxy1-lb1 10.13.3.3:${HAPROXY_PEER_PORT}
peer haproxy2-lb1 10.13.3.2:${HAPROXY_PEER_PORT}
[root@haproxy2-lb1 sysconfig]# haproxy -c -f /etc/haproxy/test-proxy.cfg
[ALERT] 083/235551 (9854) : parsing [/etc/haproxy/test-proxy.cfg:35] :
'peer haproxy1-lb1' : missing or invalid port in
'10.13.3.3:${HAPROXY_PEER_PORT}'
[ALERT] 083/235551 (9854) : parsing [/etc/haproxy/test-proxy.cfg:36] :
'peer haproxy2-lb1' : missing or invalid port in
'10.13.3.2:${HAPROXY_PEER_PORT}'
[ALERT] 083/235551 (9854) : Error(s) found in configuration file :
/etc/haproxy/test-proxy.cfg
[ALERT] 083/235551 (9854) : Proxy 'back': unable to find local peer
'haproxy2-lb1' in peers section 'lb1-peers'.
[WARNING] 083/235551 (9854) : Removing incomplete section 'peers
lb1-peers' (no peer named 'haproxy2-lb1').
[ALERT] 083/235551 (9854) : Fatal errors found in configuration.
Is there a workaround for this limitation?
Regards,
Dennis