a0edaf6c46
Revert "use statebag instead of SetSharedState for winRM password" This reverts commit b35acbd8798a1baa645f0d181731a9cd9318a61c.
26 lines
702 B
Go
26 lines
702 B
Go
package arm
|
|
|
|
import (
|
|
"context"
|
|
|
|
commonhelper "github.com/hashicorp/packer/helper/common"
|
|
"github.com/hashicorp/packer/helper/multistep"
|
|
"github.com/hashicorp/packer/packer"
|
|
)
|
|
|
|
type StepSaveWinRMPassword struct {
|
|
Password string
|
|
BuildName string
|
|
}
|
|
|
|
func (s *StepSaveWinRMPassword) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
|
|
// store so that we can access this later during provisioning
|
|
commonhelper.SetSharedState("winrm_password", s.Password, s.BuildName)
|
|
packer.LogSecretFilter.Set(s.Password)
|
|
return multistep.ActionContinue
|
|
}
|
|
|
|
func (s *StepSaveWinRMPassword) Cleanup(multistep.StateBag) {
|
|
commonhelper.RemoveSharedStateFile("winrm_password", s.BuildName)
|
|
}
|