packer-cn/builder/googlecompute/winrm.go

18 lines
467 B
Go
Raw Normal View History

package googlecompute
import (
2017-04-04 16:39:01 -04:00
"github.com/hashicorp/packer/helper/communicator"
2020-11-17 19:31:03 -05:00
"github.com/hashicorp/packer/packer-plugin-sdk/multistep"
)
// winrmConfig returns the WinRM configuration.
func winrmConfig(state multistep.StateBag) (*communicator.WinRMConfig, error) {
config := state.Get("config").(*Config)
password := state.Get("winrm_password").(string)
return &communicator.WinRMConfig{
Username: config.Comm.WinRMUser,
Password: password,
}, nil
}