Actually, this is broken: you're using this method both for the config files and the haproxy setup, which means that the servers and haproxy will use the same ports. Exactly what we need to avoid :-)