diff --git a/builder/parallels/iso/builder.go b/builder/parallels/iso/builder.go index 4a75b0b47..c8982f268 100644 --- a/builder/parallels/iso/builder.go +++ b/builder/parallels/iso/builder.go @@ -46,6 +46,7 @@ type Config struct { ISOChecksumType string `mapstructure:"iso_checksum_type"` ISOUrls []string `mapstructure:"iso_urls"` VMName string `mapstructure:"vm_name"` + TargetPath string `mapstructure:"target_path"` RawSingleISOUrl string `mapstructure:"iso_url"` @@ -218,6 +219,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe Description: "ISO", ResultKey: "iso_path", Url: b.config.ISOUrls, + TargetPath: b.config.TargetPath, }, ¶llelscommon.StepOutputDir{ Force: b.config.PackerForce, diff --git a/builder/qemu/builder.go b/builder/qemu/builder.go index 4ac22b59b..8369495d8 100644 --- a/builder/qemu/builder.go +++ b/builder/qemu/builder.go @@ -105,6 +105,7 @@ type Config struct { ShutdownCommand string `mapstructure:"shutdown_command"` SSHHostPortMin uint `mapstructure:"ssh_host_port_min"` SSHHostPortMax uint `mapstructure:"ssh_host_port_max"` + TargetPath string `mapstructure:"target_path"` VNCPortMin uint `mapstructure:"vnc_port_min"` VNCPortMax uint `mapstructure:"vnc_port_max"` VMName string `mapstructure:"vm_name"` @@ -384,6 +385,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe Description: "ISO", ResultKey: "iso_path", Url: b.config.ISOUrls, + TargetPath: b.config.TargetPath, }, new(stepPrepareOutputDir), &common.StepCreateFloppy{ diff --git a/builder/virtualbox/iso/builder.go b/builder/virtualbox/iso/builder.go index 0758e9bdd..8a19678c0 100644 --- a/builder/virtualbox/iso/builder.go +++ b/builder/virtualbox/iso/builder.go @@ -49,6 +49,7 @@ type Config struct { ISOChecksumType string `mapstructure:"iso_checksum_type"` ISOInterface string `mapstructure:"iso_interface"` ISOUrls []string `mapstructure:"iso_urls"` + TargetPath string `mapstructure:"target_path"` VMName string `mapstructure:"vm_name"` RawSingleISOUrl string `mapstructure:"iso_url"` @@ -234,6 +235,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe ResultKey: "iso_path", Url: b.config.ISOUrls, Extension: "iso", + TargetPath: b.config.TargetPath, }, &vboxcommon.StepOutputDir{ Force: b.config.PackerForce, diff --git a/builder/vmware/iso/builder.go b/builder/vmware/iso/builder.go index f2489c50f..c35719dc9 100755 --- a/builder/vmware/iso/builder.go +++ b/builder/vmware/iso/builder.go @@ -49,6 +49,7 @@ type Config struct { VMName string `mapstructure:"vm_name"` BootCommand []string `mapstructure:"boot_command"` SkipCompaction bool `mapstructure:"skip_compaction"` + TargetPath string `mapstructure:"target_path"` VMXTemplatePath string `mapstructure:"vmx_template_path"` VMXDiskTemplatePath string `mapstructure:"vmx_disk_template_path"` @@ -260,6 +261,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe Description: "ISO", ResultKey: "iso_path", Url: b.config.ISOUrls, + TargetPath: b.config.TargetPath, }, &vmwcommon.StepOutputDir{ Force: b.config.PackerForce, diff --git a/common/packer_config.go b/common/packer_config.go index 2ef86e582..67a8a8efb 100644 --- a/common/packer_config.go +++ b/common/packer_config.go @@ -4,9 +4,10 @@ package common // are sent by packer, properly tagged already so mapstructure can load // them. Embed this structure into your configuration class to get it. type PackerConfig struct { - PackerBuildName string `mapstructure:"packer_build_name"` - PackerBuilderType string `mapstructure:"packer_builder_type"` - PackerDebug bool `mapstructure:"packer_debug"` - PackerForce bool `mapstructure:"packer_force"` - PackerUserVars map[string]string `mapstructure:"packer_user_variables"` + PackerBuildName string `mapstructure:"packer_build_name"` + PackerBuilderType string `mapstructure:"packer_builder_type"` + PackerDebug bool `mapstructure:"packer_debug"` + PackerForce bool `mapstructure:"packer_force"` + PackerUserVars map[string]string `mapstructure:"packer_user_variables"` + PackerIsoTargetPath string `mapstructure:"packer_iso_target_path"` } diff --git a/common/step_download.go b/common/step_download.go index b8bd60b5e..458117bac 100644 --- a/common/step_download.go +++ b/common/step_download.go @@ -71,7 +71,7 @@ func (s *StepDownload) Run(state multistep.StateBag) multistep.StepAction { // if we force a certain extension we hash the URL and add // the extension to force it. cacheKey := url - if s.Extension != "" { + if s.Extension != "" { //HERE. hash := sha1.Sum([]byte(url)) cacheKey = fmt.Sprintf( "%s.%s", hex.EncodeToString(hash[:]), s.Extension)