2019-05-31 08:27:41 -04:00
|
|
|
//go:generate struct-markdown
|
|
|
|
|
2014-04-06 13:21:22 -04:00
|
|
|
package common
|
|
|
|
|
|
|
|
import (
|
2020-11-11 13:21:37 -05:00
|
|
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
2014-04-06 13:21:22 -04:00
|
|
|
)
|
|
|
|
|
2016-12-16 14:51:55 -05:00
|
|
|
// PrlctlVersionConfig contains the configuration for `prlctl` version.
|
2014-04-06 13:21:22 -04:00
|
|
|
type PrlctlVersionConfig struct {
|
2019-05-28 11:50:58 -04:00
|
|
|
// The path within the virtual machine to
|
2019-06-06 10:29:25 -04:00
|
|
|
// upload a file that contains the prlctl version that was used to create
|
|
|
|
// the machine. This information can be useful for provisioning. By default
|
|
|
|
// this is ".prlctl_version", which will generally upload it into the
|
|
|
|
// home directory.
|
2019-05-28 11:50:58 -04:00
|
|
|
PrlctlVersionFile string `mapstructure:"prlctl_version_file" required:"false"`
|
2014-04-06 13:21:22 -04:00
|
|
|
}
|
|
|
|
|
2016-12-16 14:51:55 -05:00
|
|
|
// Prepare sets the default value of "PrlctlVersionFile" property.
|
2015-05-27 16:49:31 -04:00
|
|
|
func (c *PrlctlVersionConfig) Prepare(ctx *interpolate.Context) []error {
|
2014-04-06 13:21:22 -04:00
|
|
|
if c.PrlctlVersionFile == "" {
|
|
|
|
c.PrlctlVersionFile = ".prlctl_version"
|
|
|
|
}
|
|
|
|
|
2015-05-27 16:49:31 -04:00
|
|
|
return nil
|
2014-04-06 13:21:22 -04:00
|
|
|
}
|