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:
parent
ab69f619e5
commit
a90376f12a
|
@ -6,6 +6,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"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,
|
steps = append(steps,
|
||||||
|
&stepAttachKeyPar{},
|
||||||
&stepRunAlicloudInstance{},
|
&stepRunAlicloudInstance{},
|
||||||
&stepMountAlicloudDisk{},
|
&stepMountAlicloudDisk{},
|
||||||
&stepAttachKeyPar{},
|
|
||||||
&communicator.StepConnect{
|
&communicator.StepConnect{
|
||||||
Config: &b.config.RunConfig.Comm,
|
Config: &b.config.RunConfig.Comm,
|
||||||
Host: SSHHost(
|
Host: SSHHost(
|
||||||
|
|
Loading…
Reference in New Issue