in my hard-learned experience with what is currently master, the answer is 'no'. I had 3 config files (cert, ca, and haproxy.cfg), and the haproxy.cfg was getting rendered and its command was triggered before the cert and CA were rendered... putting the templates in a particular order didn't matter.
template {
source = "/consul-template/template.d/internal-proxy.service.consul.pem.tmpl"
perms = 0400
destination = "/etc/haproxy/ssl/internal-proxy.service.consul.pem"
}
template {
source = "/consul-template/template.d/service.capsci.ca.pem.tmpl"
perms = 0400
destination = "/etc/haproxy/ssl/service.consul.ca.pem"
}
template {
source = "/consul-template/template.d/haproxy.tmpl"
destination = "/etc/haproxy/haproxy.cfg"
}
exec {
command = "/haproxy_run.sh"
reload_signal = "SIGUSR1"
kill_signal = "SIGTERM"
splay = "5s"
kill_timeout = "30s"
}
the problem I'm having, and I'll send an email shortly, is that the reload_signal isn't being sent, so in my case, the cert is expiring, it is being re-written to disk, but haproxy isn't being restarted and thus starts to fail because of the expired cert. But otherwise it works like a charm :)
Oh, and I forgot to mention, I'm using master and not the latest official release because of some recent patches that I needed... your milage may vary.