consul-vault: Fun with CLI

consul-vaulttools have a graphical and command line interfaces. I found CLI faster for development. So I’m sharing how to setup and use consul.


  1. Set consul and vault path.
    export VAULT_ADDR=https://xxxx
    export CONSUL_HTTP_ADDR=xxxx
  2. Login to vault
    vault login -method=github -path=github
  3. Install consul-template.
  4. Run the template.
    consul-template -vault-renew-token=false -template "./config.tmpl:/tmp/out.json" -log-level debug
  5. You can also access consul KV store from CLI. It’s much convenient to GET & PUT info.
      consul kv get -detailed database/staging/servers   


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: