Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provisioner/powershell: Add wrapper script to default provisioner runs #9884

Closed
wants to merge 6 commits into from

Conversation

nywilken
Copy link
Contributor

@nywilken nywilken commented Sep 3, 2020

This change adds a wrapper script to the provisioner for improved error handling. The wrapper script is enabled by default, but will be disabled when using a custom ExecuteCommand or ElevatedExecuteCommand.

The wrapper script will include the contents of any provided Inline commands or Scripts as part of its payload and run as a single script with environment variables loaded within the script. This changes the existing behavior of uploading and running any defined script(s) directly to the remote host

Closes #4916, #9757, #9400, #9161

Todo

  • validate approach
  • Fix broken test
  • test against custom execute commands
  • support wrapped script when using execute command

This change adds a wrapper script to the provisioner for improved error
handling. The wrapper script is enabled by default, but will be disabled
when using a custom ExecuteCommand or ElevatedExecuteCommand.

The wrapper script will include the contents of any provided Inline
commands or Scripts as part of its payload and run as a single script
with environment variables loaded within the script. This changes the
existing behavior of uploading any defined script(s) unmodified to the
remote host.
config Config
communicator packer.Communicator
generatedData map[string]interface{}
useWrappedCommmand bool
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Old artifact that needs to be removed.

@nywilken
Copy link
Contributor Author

nywilken commented Jan 4, 2021

Closing this PR for now. Will revisit at a later time.

@nywilken nywilken closed this Jan 4, 2021
@ghost
Copy link

ghost commented Feb 4, 2021

I'm going to lock this issue 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 similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators Feb 4, 2021
@azr azr deleted the b-powershell-exitcodes branch January 11, 2022 15:40
@azr azr restored the b-powershell-exitcodes branch January 11, 2022 15:40
@azr azr deleted the b-powershell-exitcodes branch January 11, 2022 15:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PowerShell provisioner silently ignores some types of errors
1 participant