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