Merge pull request #8670 from hashicorp/fix_8619
builder/azure-arm: Set WinRMPassword on the communicator config
This commit is contained in:
commit
18f14fc368
|
@ -166,7 +166,6 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||
b.setRuntimeParameters(b.stateBag)
|
||||
b.setTemplateParameters(b.stateBag)
|
||||
b.setImageParameters(b.stateBag)
|
||||
var steps []multistep.Step
|
||||
|
||||
deploymentName := b.stateBag.Get(constants.ArmDeploymentName).(string)
|
||||
|
||||
|
@ -195,6 +194,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||
b.stateBag.Put(constants.ArmManagedImageSharedGalleryReplicationRegions, b.config.SharedGalleryDestination.SigDestinationReplicationRegions)
|
||||
}
|
||||
|
||||
var steps []multistep.Step
|
||||
if b.config.OSType == constants.Target_Linux {
|
||||
steps = []multistep.Step{
|
||||
NewStepCreateResourceGroup(azureClient, ui),
|
||||
|
@ -240,7 +240,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||
WinRMConfig: func(multistep.StateBag) (*communicator.WinRMConfig, error) {
|
||||
return &communicator.WinRMConfig{
|
||||
Username: b.config.UserName,
|
||||
Password: b.config.tmpAdminPassword,
|
||||
Password: b.config.Comm.WinRMPassword,
|
||||
}, nil
|
||||
},
|
||||
},
|
||||
|
|
|
@ -640,8 +640,13 @@ func setUserNamePassword(c *Config) {
|
|||
|
||||
if c.Comm.SSHPassword != "" {
|
||||
c.Password = c.Comm.SSHPassword
|
||||
} else {
|
||||
c.Password = c.tmpAdminPassword
|
||||
return
|
||||
}
|
||||
|
||||
// Configure password settings using Azure generated credentials
|
||||
c.Password = c.tmpAdminPassword
|
||||
if c.Comm.WinRMPassword == "" {
|
||||
c.Comm.WinRMPassword = c.Password
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue