I pretty much live in a
bash world for most of my interaction outside of the web browser. Here is a snippet of my
.bashrc file that saves me some time.
export VAULT_ADDR="https://your-vault-server-domain" export NOMAD_ADDR="https://your-nomad-server-domain" export CONSUL_ADDR="https://your-consul-server-domain" alias vl='vault login -method=oidc' alias nl='export NOMAD_TOKEN=$(vault read -field=secret_id nomad/creds/developer)' alias cl='export CONSUL_HTTP_TOKEN=$(vault read -field=token consul/creds/developer)'
My workflow is:
vl– Log into Vault
nl– Retrieve and set Nomad credentials
cl– Retrieve and set Consul credentials
I decided to keep these as separate aliases to only retrieve the tokens I need. I generally use Vault and Nomad the most. My tokens expire after 1 hour, so this saves me quite a bit of typing.