Backport of ci: pull secrets from Vault in nomad-enterprise into release/1.4.x #17845
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport
This PR is auto-generated from #17841 to be assessed for backporting due to the inclusion of the label backport/1.4.x.
The below text is copied from the body of the original PR.
Now that (most) secrets-requiring workflows run on self-hosted runners in nomad-enterprise (#17775), we're able to (conditionally) pull secrets from our internal CI Vault cluster.
The approach here uses a composite action to avoid repetitive boilerplate, which also means it needs* to set secrets as env vars (also the default behavior of hashicorp/vault-action, and common practice in other projects, sans the composite action). Otherwise, it would require an odd maneuver, for GHA reasons, to have the composite output a dynamic map instead (*but it is possible, if we really want to. ask me how if you'd like).
As with the aforementioned PR, this is here in OSS Nomad repo to avoid merge conflicts with enterprise. I've pre-tested the workflows there, so hopefully no runtime surprises when we go to merge oss->ent.