hashicorp / hashicorp/packer

Use ~/.vault-token if `VAULT_TOKEN` env var not set

Open
#11,567 2 comments 2 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.