Skip to content

all shells: Pass env vars through a key value store#11569

Merged
azr merged 13 commits intomasterfrom
azr/shell-map-env
Feb 16, 2022
Merged

all shells: Pass env vars through a key value store#11569
azr merged 13 commits intomasterfrom
azr/shell-map-env

Conversation

@azr
Copy link
Copy Markdown
Contributor

@azr azr commented Feb 15, 2022

This potentially fixes #11197, by allowing to set shell env vars from a key/value map.

Merge hashicorp/packer-plugin-sdk#98 first.

  • shell: add env key/value store possibility
  • docs shell
  • docs shell-local
  • docs PowerShell
  • docs windows shell
  • docs shell-local-post-processor
  • validation test
  • build test
  • build test on windows

@azr azr marked this pull request as ready for review February 15, 2022 13:04
@azr azr requested a review from a team as a code owner February 15, 2022 13:04
]
}
provisioner "shell-local" {
only_on = ["windows"]
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a neat feature for tests

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice little gem.

Copy link
Copy Markdown
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I do wonder if we should deprecate the environment_vars field.

@azr
Copy link
Copy Markdown
Contributor Author

azr commented Feb 16, 2022

Good question, I would think not here, since for the people using environment_vars: this is not a new feature, but more like a bug fix and I bet a looooot of configs out there use this value.

On another side: these work with datasources, so it's way better 🤔 .

@azr azr merged commit 0362a3e into master Feb 16, 2022
@azr azr deleted the azr/shell-map-env branch February 16, 2022 11:05
@github-actions
Copy link
Copy Markdown

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Mar 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

packer can't validate when using the output of a data lookup as a value in shell provisioner environment_vars element

2 participants