Use ~/.vault-token if `VAULT_TOKEN` env var not set
Open
enhancement
sync to jira
- Dominant language
- Go
- Stars
- 15.8k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
#### Description
When the env var `VAULT_TOKEN` is not set, Packer should fall back to using `~/.vault-token`. At present, it requires the env var, and will complain if it is not set.
```
Call to function "vault" failed: Must set VAULT_TOKEN env var in order to use
vault template function.
```
Terraform already uses `~/.vault-token` AFAIK, but will accept an override from `VAULT_TOKEN` if said env var is set.
#### Use Case(s)
Any time Packer needs to retrieve a secret from vault, for just one example - fetching the chef client validation pem to bake into the image.
#### Potential configuration
No additional configuration necessary.
#### Potential References
Contributor guide
Assessment
This issue has not been assessed yet.