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.

Steps

  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   
    

References