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

Box restarts even if provisioning fails #1

Open
mefellows opened this issue Feb 2, 2015 · 2 comments
Open

Box restarts even if provisioning fails #1

mefellows opened this issue Feb 2, 2015 · 2 comments

Comments

@mefellows
Copy link
Owner

If provisioning fails, the box restart is still performed.

It seems that the run_remote_command_runner method in provisioner.rb never returns an error code > 0 (even if powershell script fails), which is likely the main issue.

@mefellows
Copy link
Owner Author

Closed due to #7.

Exit codes are now determined by presence or lack-thereof of :stderr responses. Box will not restart if machine provisioning fails.

@mefellows
Copy link
Owner Author

I had to re-instate the use of the sudo shell method to ensure the command is run as an elevated user. This has had a knock-on effect that detecting a valid exit code is now even more difficult than before.

As an example, we now have nicely formatted output but when a command fails we cannot detect it (and color is not red):

==> default: "Running Windows Domain Provisioner"
VERBOSE: Performing the operation "Join in domain 'seek.int'" on target "talentsearchapi".Add-Computer : Computer 'talentsearchapi' failed to join domain 'seek.int'
from its current workgroup 'WORKGROUP' with following error message: Access is
denied.
At C:\tmp\vagrant-windows-domain-runner.ps1:3 char:1
+ Add-Computer -DomainName seek.int -Credential $credentials -NewName
'tsapi7d66ef ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (talentsearchapi:String) [Add-
   Computer], InvalidOperationException
    + FullyQualifiedErrorId : FailToJoinDomainFromWorkgroup,Microsoft.PowerShe
   ll.Commands.AddComputerCommand
 Restarting computer for updates to take effect.

@mefellows mefellows reopened this Feb 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant