Attach keypair before starting instance in alicloud builder

[Documentation of `AttachKeyPair`](https://goo.gl/gC3srG) states that
attaching keypair to running instance takes effect after reboot.
So we need to attach keypair before starting instance to avoid an
additional restart.
This commit is contained in:
QuantumGhost 2017-12-29 10:03:55 +08:00
parent ab69f619e5
commit a90376f12a
1 changed files with 2 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import (
"log"
"fmt"
"github.com/hashicorp/packer/common"
"github.com/hashicorp/packer/helper/communicator"
"github.com/hashicorp/packer/helper/config"
@ -146,9 +147,9 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
})
}
steps = append(steps,
&stepAttachKeyPar{},
&stepRunAlicloudInstance{},
&stepMountAlicloudDisk{},
&stepAttachKeyPar{},
&communicator.StepConnect{
Config: &b.config.RunConfig.Comm,
Host: SSHHost(