vault read -format=json auth/approle/role/certs/role-id | \
jq -r .data.role_id > .role-id
vault write -format=json -f auth/approle/role/certs/secret-id | \
jq -r .data.secret_id > .secret-id
Start the vault agent in one window(screen/tmux/tabs/etc.)
vault agent -config=agent.hcl
Start consul-template in another window
consul-template -vault-agent-token-file=token-sink -vault-renew-token=false \
-template "cert.pem.tpl:cert.pem" -log-level=debug
Watch the file contents in another window(need to brew install watch on a mac)
watch -n 1 cat cert.pem