Merge pull request #2351 from mitchellh/f-winrm-debug

builder/amazon: output WinRM password for debug mode [GH-2336]
This commit is contained in:
Mitchell Hashimoto 2015-06-29 13:46:51 -07:00
commit d3ed169175
3 changed files with 10 additions and 0 deletions

View File

@ -19,6 +19,7 @@ import (
// StepGetPassword reads the password from a Windows server and sets it // StepGetPassword reads the password from a Windows server and sets it
// on the WinRM config. // on the WinRM config.
type StepGetPassword struct { type StepGetPassword struct {
Debug bool
Comm *communicator.Config Comm *communicator.Config
Timeout time.Duration 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 return multistep.ActionContinue
} }

View File

@ -119,6 +119,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
Tags: b.config.RunTags, Tags: b.config.RunTags,
}, },
&awscommon.StepGetPassword{ &awscommon.StepGetPassword{
Debug: b.config.PackerDebug,
Comm: &b.config.RunConfig.Comm, Comm: &b.config.RunConfig.Comm,
Timeout: b.config.WindowsPasswordTimeout, Timeout: b.config.WindowsPasswordTimeout,
}, },

View File

@ -204,6 +204,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
Tags: b.config.RunTags, Tags: b.config.RunTags,
}, },
&awscommon.StepGetPassword{ &awscommon.StepGetPassword{
Debug: b.config.PackerDebug,
Comm: &b.config.RunConfig.Comm, Comm: &b.config.RunConfig.Comm,
Timeout: b.config.WindowsPasswordTimeout, Timeout: b.config.WindowsPasswordTimeout,
}, },