feat(secrets): with-vault.sh --env (same environment as ./setup) #228

Merged
jfraeys merged 1 commit from jfraeys/feat/with-vault-env-flag into main 2026-10-16 14:41:57 -04:00
Owner

The OVH rehearsal's services play stopped at traefik: 'TF_VAR_cloudflare_api_token is required'. The role reads it with lookup('env', ...); ./setup exports the vault's TF_VAR_* and related secrets through common_vault_load_env, but with-vault.sh only decrypts vault.yml for include_vars. --env calls common_vault_load_env before running the command. Opt-in: the default behavior and all existing callers are unchanged.

Checked: test-with-vault-env.sh (5 cases with a stub library, in lint.yml); against the real vault from a worktree, with --env the Cloudflare/deSEC tokens, ssh_port and OBJECT_STORAGE key are set in the command's environment, without it the token is unset.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ

The OVH rehearsal's services play stopped at traefik: 'TF_VAR_cloudflare_api_token is required'. The role reads it with lookup('env', ...); ./setup exports the vault's TF_VAR_* and related secrets through common_vault_load_env, but with-vault.sh only decrypts vault.yml for include_vars. --env calls common_vault_load_env before running the command. Opt-in: the default behavior and all existing callers are unchanged. Checked: test-with-vault-env.sh (5 cases with a stub library, in lint.yml); against the real vault from a worktree, with --env the Cloudflare/deSEC tokens, ssh_port and OBJECT_STORAGE key are set in the command's environment, without it the token is unset. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ
feat(secrets): with-vault.sh --env exports the vault environment like ./setup does
All checks were successful
Lint / lint (pull_request) Successful in 2m0s
Secret scan / scan (pull_request) Successful in 15s
adaf1fc4cb
A direct ansible-playbook run through with-vault.sh had vault.yml for include_vars but none of the TF_VAR_* environment
that ./setup exports; traefik reads its Cloudflare token with lookup('env', 'TF_VAR_cloudflare_api_token') and failed on the
OVH rehearsal. --env is opt-in; the default is unchanged. Test: test-with-vault-env.sh (stub vault library), plus a manual
check against the real vault (tokens set with --env, unset without).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfraeys/infra!228
No description provided.