Open allanlang opened 6 years ago
I have exactly the same issue. My template is :
{{ with printf "public_key=%s" (file "/etc/ssh/ssh_host_rsa_key.pub") | secret "ssh-hosts/sign/host" "cert_type=host" "ttl=76h" }}{{ .Data.signed_key }}{{end}}
the config file has
template {
error_on_missing_key = true
perms = 0600
source = "/etc/ssh/ssh_host_rsa_key-cert.pub.tpl"
destination = "/etc/ssh/ssh_host_rsa_key-cert.pub"
command = "/usr/bin/systemctl restart sshd"
}
and sshd keeps getting restarted every ~90 seconds
Found the issue for my use case, the secret returned by the ssh backend has lease=0, so consul-template is correctly renewing it at every run.
"lease_id": "",
"lease_duration": 0,
"renewable": false,
Thanks for reporting the issue @allanlang.
As reproducing this requires a more complex setup it is going to take some time to get to this issue. I know it has been a while, but if you are still experiencing this and are able to provide a minimal setup to reproduce it, it would be a big help. Thanks.
Soooo what was the solution to this problem? We are having the same issue. Consul-Template is reloading NGINX way more than it should be.
Hey @dheide951,
I was not able to reproduce the original issue so haven't made any progress. If you can reproduce it and can provide the relevant details to allow me to do so that would be a big help. You can add your details here or file a new issue (if so, please mention this one).
Thanks.
Consul Template version
0.19.3
Configuration
No configuration file is used.
Template file is defined as:
Command
Debug output
https://gist.github.com/allanlang/c1857a111104f4a6ed53ba281898be2c
Expected behavior
Given no changes in the underlying state of "dashboard" services in Consul, the templated file /tmp/dashboard.conf should not be re-rendered, and the nginx service should not be signalled to reload.
Actual behavior
/tmp/dashboard.conf is continually re-rendered with exactly the same content (md5sum matches across multiple renderings). nginx is triggered to reload continually (/var/log/nginx/error.log shows multiple instances of
signal process started
).Steps to reproduce
References