scaleway: add boottype parameter in config

This commit is contained in:
Florian Florensa 2018-09-27 16:27:33 +02:00
parent 35ba921b7d
commit 9ea5104b74
3 changed files with 9 additions and 0 deletions

View File

@ -30,6 +30,7 @@ type Config struct {
ImageName string `mapstructure:"image_name"`
ServerName string `mapstructure:"server_name"`
Bootscript string `mapstructure:"bootscript"`
BootType string `mapstructure:"boottype"`
UserAgent string
ctx interpolate.Context
@ -86,6 +87,10 @@ func NewConfig(raws ...interface{}) (*Config, []string, error) {
c.ServerName = fmt.Sprintf("packer-%s", uuid.TimeOrderedUUID())
}
if c.BootType == "" {
c.BootType = "bootscript"
}
var errs *packer.MultiError
if es := c.Comm.Prepare(&c.ctx); len(es) > 0 {
errs = packer.MultiErrorAppend(errs, es...)

View File

@ -38,6 +38,7 @@ func (s *stepCreateServer) Run(_ context.Context, state multistep.StateBag) mult
CommercialType: c.CommercialType,
Tags: tags,
Bootscript: bootscript,
BootType: c.BootType,
})
if err != nil {

View File

@ -74,6 +74,9 @@ builder.
- `snapshot_name` (string) - The name of the resulting snapshot that will
appear in your account. Default `packer-TIMESTAMP`
- `boottype` (string) - The type of boot, can be either `local` or `bootscript`,
Default `bootscript`
- `bootscript` (string) - The id of an existing bootscript to use when booting
the server.