I'm attempting to use CT to retrieve a dynamically generated Consul token from Vault and then use that as CT's token (if you follow my meaning.)
Here's my template:
token = "{{ with secret "consul/creds/ct" }}{{ .Data.token }}{{ end }}"
And the template config
template {
source = "./templates/token.hcl.ctmpl"
destination = "./config/token.hcl"
command = "pkill -SIGHUP $PPID"
}
That.. kinda works... `token.hcl` is created ok but when CT reloads the secret is regenerated. Which defeats the whole point. This is supposed to be a one-time operation and then CT would (should) renew the lease on the token thereafter (that renewal on the dynamic secret is the real point of this exercise.)
Why should SIGHUP cause the secret to be re-retrieved?
Maybe I'm trying to get too fancy here.
- Russell