Closed arrrgi closed 9 months ago
Thanks for reporting this. The issue was that chezmoi init --apply
was not setting the environment variables defined in the config file after re-reading the config file. #3372 should fix this. Would you be able to test it?
I've not installed from source before but it's not beyond me, I'll test as soon as I can and let you know.
Thanks for the quick turnaround though, I'll endeavour to do the same.
You can download a compiled binary for your architecture in the Artifacts section at the bottom of this page: https://github.com/twpayne/chezmoi/actions/runs/7023347012?pr=3372
If your OS/arch combo isn't listed please tell me.
Confirmed working with both linux/amd64 and darwin/arm64 with this latest build snapshot.
Describe the bug
Applying templates which use HCP Vault Secrets throws an error even though these are set in the env key in Chezmoi's config on first apply when combined as
chezmoi init arrrgi --apply --branch=feature/setup-scripts
HCP Vault Secrets templating works fine when init and apply are performed as separate steps, ie.
To reproduce
Run
chezmoi init arrrgi --apply --verbose
and provide Vault Secrets HCP_CLIENT_ID, HCP_CLIENT_SECRET, Organization and Project values via thepromptStringOnce
functions in .chezmoi.yaml.tmplExpected behavior
The repo is cloned, the prompted values are stored in Chezmoi config, the template fetches secrets to replace templated values.
Output of command with the
--verbose
flagOutput of
chezmoi doctor
Additional context
The resulting ~/.config/chezmoi/chezmoi.yaml file contains: