Merge pull request #6439 from jbonachera/scaleway-config-bootscript
scaleway: add 'bootscript' configuration parameter
This commit is contained in:
commit
4b1f96b527
|
@ -29,6 +29,7 @@ type Config struct {
|
|||
SnapshotName string `mapstructure:"snapshot_name"`
|
||||
ImageName string `mapstructure:"image_name"`
|
||||
ServerName string `mapstructure:"server_name"`
|
||||
Bootscript string `mapstructure:"bootscript"`
|
||||
|
||||
UserAgent string
|
||||
ctx interpolate.Context
|
||||
|
|
|
@ -20,9 +20,14 @@ func (s *stepCreateServer) Run(_ context.Context, state multistep.StateBag) mult
|
|||
c := state.Get("config").(Config)
|
||||
sshPubKey := state.Get("ssh_pubkey").(string)
|
||||
tags := []string{}
|
||||
var bootscript *string
|
||||
|
||||
ui.Say("Creating server...")
|
||||
|
||||
if c.Bootscript != "" {
|
||||
bootscript = &c.Bootscript
|
||||
}
|
||||
|
||||
if sshPubKey != "" {
|
||||
tags = []string{fmt.Sprintf("AUTHORIZED_KEY=%s", strings.TrimSpace(sshPubKey))}
|
||||
}
|
||||
|
@ -33,6 +38,7 @@ func (s *stepCreateServer) Run(_ context.Context, state multistep.StateBag) mult
|
|||
Organization: c.Organization,
|
||||
CommercialType: c.CommercialType,
|
||||
Tags: tags,
|
||||
Bootscript: bootscript,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
|
|
|
@ -74,6 +74,9 @@ builder.
|
|||
- `snapshot_name` (string) - The name of the resulting snapshot that will
|
||||
appear in your account. Default `packer-TIMESTAMP`
|
||||
|
||||
- `bootscript` (string) - The id of an existing bootscript to use when booting
|
||||
the server.
|
||||
|
||||
## Basic Example
|
||||
|
||||
Here is a basic example. It is completely valid as soon as you enter your own
|
||||
|
|
Loading…
Reference in New Issue