From 9ea5104b740c8c34d412b4840720c6f5ce6de800 Mon Sep 17 00:00:00 2001 From: Florian Florensa Date: Thu, 27 Sep 2018 16:27:33 +0200 Subject: [PATCH] scaleway: add boottype parameter in config --- builder/scaleway/config.go | 5 +++++ builder/scaleway/step_create_server.go | 1 + website/source/docs/builders/scaleway.html.md | 3 +++ 3 files changed, 9 insertions(+) diff --git a/builder/scaleway/config.go b/builder/scaleway/config.go index 4d677bcfc..f7a90c55a 100644 --- a/builder/scaleway/config.go +++ b/builder/scaleway/config.go @@ -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...) diff --git a/builder/scaleway/step_create_server.go b/builder/scaleway/step_create_server.go index 8a22c87d0..080186a52 100644 --- a/builder/scaleway/step_create_server.go +++ b/builder/scaleway/step_create_server.go @@ -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 { diff --git a/website/source/docs/builders/scaleway.html.md b/website/source/docs/builders/scaleway.html.md index bcef9f900..4292e0826 100644 --- a/website/source/docs/builders/scaleway.html.md +++ b/website/source/docs/builders/scaleway.html.md @@ -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.