Fix usage of rescue system
This commit is contained in:
parent
b6ee0ea736
commit
cc2267fd2a
|
@ -87,6 +87,7 @@ func (s *stepCreateServer) Run(ctx context.Context, state multistep.StateBag) mu
|
|||
}
|
||||
|
||||
if c.RescueMode != "" {
|
||||
ui.Say("Enabling Rescue Mode...")
|
||||
rootPassword, err := setRescue(context.TODO(), client, serverCreateResult.Server, c.RescueMode, sshKeys)
|
||||
if err != nil {
|
||||
err := fmt.Errorf("Error enabling rescue mode: %s", err)
|
||||
|
@ -94,6 +95,20 @@ func (s *stepCreateServer) Run(ctx context.Context, state multistep.StateBag) mu
|
|||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
ui.Say("Reboot server...")
|
||||
action, _, err := client.Server.Reset(context.TODO(), serverCreateResult.Server)
|
||||
if err != nil {
|
||||
err := fmt.Errorf("Error rebooting server: %s", err)
|
||||
state.Put("error", err)
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
if err := waitForAction(context.TODO(), client, action); err != nil {
|
||||
err := fmt.Errorf("Error rebooting server: %s", err)
|
||||
state.Put("error", err)
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
if c.RescueMode == "freebsd64" {
|
||||
// We will set this only on freebsd
|
||||
ui.Say("Using Root Password instead of SSH Keys...")
|
||||
|
|
Loading…
Reference in New Issue