From 0a2e54feaf0714541fba475ee9dd79807f475149 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 29 Jun 2015 09:40:15 -0700 Subject: [PATCH] builder/amazon: output WinRM password for debug mode [GH-2336] --- builder/amazon/common/step_get_password.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/builder/amazon/common/step_get_password.go b/builder/amazon/common/step_get_password.go index ab51f4394..08a9c7b66 100644 --- a/builder/amazon/common/step_get_password.go +++ b/builder/amazon/common/step_get_password.go @@ -19,6 +19,7 @@ import ( // StepGetPassword reads the password from a Windows server and sets it // on the WinRM config. type StepGetPassword struct { + Debug bool Comm *communicator.Config Timeout time.Duration } @@ -85,6 +86,13 @@ WaitLoop: } } } + + // In debug-mode, we output the password + if s.Debug { + ui.Message(fmt.Sprintf( + "Password (since debug is enabled): %s", s.Comm.WinRMPassword)) + } + return multistep.ActionContinue }