2019-05-31 14:27:41 +02:00
|
|
|
//go:generate struct-markdown
|
|
|
|
|
2015-05-03 11:18:48 +02:00
|
|
|
package common
|
|
|
|
|
|
|
|
import (
|
2017-04-04 13:39:01 -07:00
|
|
|
"github.com/hashicorp/packer/template/interpolate"
|
2015-05-03 11:18:48 +02:00
|
|
|
)
|
|
|
|
|
2016-12-16 21:51:55 +02:00
|
|
|
// PrlctlPostConfig contains the configuration for running "prlctl" commands
|
|
|
|
// in the end of artifact build.
|
2015-05-03 11:18:48 +02:00
|
|
|
type PrlctlPostConfig struct {
|
2019-05-28 17:50:58 +02:00
|
|
|
// Identical to prlctl, except
|
2019-06-06 16:29:25 +02:00
|
|
|
// that it is run after the virtual machine is shutdown, and before the virtual
|
|
|
|
// machine is exported.
|
2019-05-28 17:50:58 +02:00
|
|
|
PrlctlPost [][]string `mapstructure:"prlctl_post" required:"false"`
|
2015-05-03 11:18:48 +02:00
|
|
|
}
|
|
|
|
|
2016-12-16 21:51:55 +02:00
|
|
|
// Prepare sets the default value of "PrlctlPost" property.
|
2015-06-22 12:46:13 -07:00
|
|
|
func (c *PrlctlPostConfig) Prepare(ctx *interpolate.Context) []error {
|
2015-05-03 11:18:48 +02:00
|
|
|
if c.PrlctlPost == nil {
|
|
|
|
c.PrlctlPost = make([][]string, 0)
|
|
|
|
}
|
|
|
|
|
2015-06-22 12:46:13 -07:00
|
|
|
return nil
|
2015-05-03 11:18:48 +02:00
|
|
|
}
|