Merge pull request #6772 from fflorens/scaleway-add-boottype

scaleway: add boottype parameter in config
This commit is contained in:
Adrien Delorme 2018-09-27 16:51:01 +02:00 committed by GitHub
commit b7b1720a91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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.