jenkinsci / hashicorp-vault-plugin

Jenkins plugin to populate environment variables from secrets stored in HashiCorp's Vault.
https://plugins.jenkins.io/hashicorp-vault-plugin/
MIT License
217 stars 145 forks source link

Jenkins environment variables substitution #279

Open morriell opened 1 year ago

morriell commented 1 year ago

What feature do you want to see added?

Some times is essential to switch Vault URL. But currently there is no good manageable way to do it. Using environment variables in Vault configuration seems obvious, although it does not work. Vault plugin does not provide variable substitution on any configuration level.

I have undertaken a small investigation and I've tried various versions of vault plugin and various configurations. None of these combinations support variable expansion.

Here is a sample. There is DEFAULT_VAULT_URL environment variable set in Jenkins settings. image And there is a job configured to use that variable image The job should simply print the value obtained from Vault: image The job configured this way fails with an error: image The last picture shows that the DEFAULT_VAULT_URL variable was not expanded.

Upstream changes

No response