|
|
|
|
@ -111,7 +111,6 @@ type EnvVarsTemplate struct {
|
|
|
|
|
|
|
|
|
|
func (p *Provisioner) Prepare(raws ...interface{}) error {
|
|
|
|
|
//Create passthrough for winrm password so we can fill it in once we know it
|
|
|
|
|
log.Printf("MEGAN context is %#v", p.config.ctx)
|
|
|
|
|
p.config.ctx.Data = &EnvVarsTemplate{
|
|
|
|
|
WinRMPassword: `{{.WinRMPassword}}`,
|
|
|
|
|
}
|
|
|
|
|
@ -248,7 +247,6 @@ func extractScript(p *Provisioner) (string, error) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
|
|
|
|
|
log.Printf("MEGAN context is %#v", p.config.ctx)
|
|
|
|
|
ui.Say(fmt.Sprintf("Provisioning with Powershell..."))
|
|
|
|
|
p.communicator = comm
|
|
|
|
|
|
|
|
|
|
@ -462,8 +460,8 @@ func (p *Provisioner) createCommandTextNonPrivileged() (command string, err erro
|
|
|
|
|
func getWinRMPassword() string {
|
|
|
|
|
winRMPass, _ := commonhelper.RetrieveSharedState("winrm_password")
|
|
|
|
|
return winRMPass
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p *Provisioner) createCommandTextPrivileged() (command string, err error) {
|
|
|
|
|
// Prepare everything needed to enable the required env vars within the remote environment
|
|
|
|
|
envVarPath, err := p.prepareEnvVars(true)
|
|
|
|
|
|