Merge pull request #2642 from oliviertremblay/master

Make TargetPath customizable
This commit is contained in:
Mark Peek 2015-10-20 12:11:13 -07:00
commit e9657e6a9f
8 changed files with 24 additions and 0 deletions

View File

@ -47,6 +47,7 @@ type Config struct {
ISOUrls []string `mapstructure:"iso_urls"` ISOUrls []string `mapstructure:"iso_urls"`
SkipCompaction bool `mapstructure:"skip_compaction"` SkipCompaction bool `mapstructure:"skip_compaction"`
VMName string `mapstructure:"vm_name"` VMName string `mapstructure:"vm_name"`
TargetPath string `mapstructure:"iso_target_path"`
RawSingleISOUrl string `mapstructure:"iso_url"` RawSingleISOUrl string `mapstructure:"iso_url"`
@ -220,6 +221,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
Description: "ISO", Description: "ISO",
ResultKey: "iso_path", ResultKey: "iso_path",
Url: b.config.ISOUrls, Url: b.config.ISOUrls,
TargetPath: b.config.TargetPath,
}, },
&parallelscommon.StepOutputDir{ &parallelscommon.StepOutputDir{
Force: b.config.PackerForce, Force: b.config.PackerForce,

View File

@ -106,6 +106,7 @@ type Config struct {
ShutdownCommand string `mapstructure:"shutdown_command"` ShutdownCommand string `mapstructure:"shutdown_command"`
SSHHostPortMin uint `mapstructure:"ssh_host_port_min"` SSHHostPortMin uint `mapstructure:"ssh_host_port_min"`
SSHHostPortMax uint `mapstructure:"ssh_host_port_max"` SSHHostPortMax uint `mapstructure:"ssh_host_port_max"`
TargetPath string `mapstructure:"iso_target_path"`
VNCPortMin uint `mapstructure:"vnc_port_min"` VNCPortMin uint `mapstructure:"vnc_port_min"`
VNCPortMax uint `mapstructure:"vnc_port_max"` VNCPortMax uint `mapstructure:"vnc_port_max"`
VMName string `mapstructure:"vm_name"` VMName string `mapstructure:"vm_name"`
@ -385,6 +386,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
Description: "ISO", Description: "ISO",
ResultKey: "iso_path", ResultKey: "iso_path",
Url: b.config.ISOUrls, Url: b.config.ISOUrls,
TargetPath: b.config.TargetPath,
}, },
new(stepPrepareOutputDir), new(stepPrepareOutputDir),
&common.StepCreateFloppy{ &common.StepCreateFloppy{

View File

@ -47,6 +47,7 @@ type Config struct {
ISOChecksumType string `mapstructure:"iso_checksum_type"` ISOChecksumType string `mapstructure:"iso_checksum_type"`
ISOInterface string `mapstructure:"iso_interface"` ISOInterface string `mapstructure:"iso_interface"`
ISOUrls []string `mapstructure:"iso_urls"` ISOUrls []string `mapstructure:"iso_urls"`
TargetPath string `mapstructure:"iso_target_path"`
VMName string `mapstructure:"vm_name"` VMName string `mapstructure:"vm_name"`
RawSingleISOUrl string `mapstructure:"iso_url"` RawSingleISOUrl string `mapstructure:"iso_url"`
@ -229,6 +230,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
ResultKey: "iso_path", ResultKey: "iso_path",
Url: b.config.ISOUrls, Url: b.config.ISOUrls,
Extension: "iso", Extension: "iso",
TargetPath: b.config.TargetPath,
}, },
&vboxcommon.StepOutputDir{ &vboxcommon.StepOutputDir{
Force: b.config.PackerForce, Force: b.config.PackerForce,

View File

@ -48,6 +48,7 @@ type Config struct {
VMName string `mapstructure:"vm_name"` VMName string `mapstructure:"vm_name"`
BootCommand []string `mapstructure:"boot_command"` BootCommand []string `mapstructure:"boot_command"`
SkipCompaction bool `mapstructure:"skip_compaction"` SkipCompaction bool `mapstructure:"skip_compaction"`
TargetPath string `mapstructure:"iso_target_path"`
VMXTemplatePath string `mapstructure:"vmx_template_path"` VMXTemplatePath string `mapstructure:"vmx_template_path"`
VMXDiskTemplatePath string `mapstructure:"vmx_disk_template_path"` VMXDiskTemplatePath string `mapstructure:"vmx_disk_template_path"`
@ -256,6 +257,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
Description: "ISO", Description: "ISO",
ResultKey: "iso_path", ResultKey: "iso_path",
Url: b.config.ISOUrls, Url: b.config.ISOUrls,
TargetPath: b.config.TargetPath,
}, },
&vmwcommon.StepOutputDir{ &vmwcommon.StepOutputDir{
Force: b.config.PackerForce, Force: b.config.PackerForce,

View File

@ -138,6 +138,10 @@ builder.
to force the HTTP server to be on one port, make this minimum and maximum to force the HTTP server to be on one port, make this minimum and maximum
port the same. By default the values are 8000 and 9000, respectively. port the same. By default the values are 8000 and 9000, respectively.
- `iso_target_path` (string) - The path where the iso should be saved after
download. By default will go in the packer cache, with a hash of the
original filename as its name.
- `iso_urls` (array of strings) - Multiple URLs for the ISO to download. - `iso_urls` (array of strings) - Multiple URLs for the ISO to download.
Packer will try these in order. If anything goes wrong attempting to Packer will try these in order. If anything goes wrong attempting to
download or while downloading a single URL, it will move on to the next. All download or while downloading a single URL, it will move on to the next. All

View File

@ -167,6 +167,10 @@ builder.
to force the HTTP server to be on one port, make this minimum and maximum to force the HTTP server to be on one port, make this minimum and maximum
port the same. By default the values are 8000 and 9000, respectively. port the same. By default the values are 8000 and 9000, respectively.
- `iso_target_path` (string) - The path where the iso should be saved after
download. By default will go in the packer cache, with a hash of the
original filename as its name.
- `iso_urls` (array of strings) - Multiple URLs for the ISO to download. - `iso_urls` (array of strings) - Multiple URLs for the ISO to download.
Packer will try these in order. If anything goes wrong attempting to Packer will try these in order. If anything goes wrong attempting to
download or while downloading a single URL, it will move on to the next. All download or while downloading a single URL, it will move on to the next. All

View File

@ -170,6 +170,10 @@ builder.
to, defaults to "ide". When set to "sata", the drive is attached to an AHCI to, defaults to "ide". When set to "sata", the drive is attached to an AHCI
SATA controller. SATA controller.
- `iso_target_path` (string) - The path where the iso should be saved after
download. By default will go in the packer cache, with a hash of the
original filename as its name.
- `iso_urls` (array of strings) - Multiple URLs for the ISO to download. - `iso_urls` (array of strings) - Multiple URLs for the ISO to download.
Packer will try these in order. If anything goes wrong attempting to Packer will try these in order. If anything goes wrong attempting to
download or while downloading a single URL, it will move on to the next. All download or while downloading a single URL, it will move on to the next. All

View File

@ -148,6 +148,10 @@ builder.
to force the HTTP server to be on one port, make this minimum and maximum to force the HTTP server to be on one port, make this minimum and maximum
port the same. By default the values are 8000 and 9000, respectively. port the same. By default the values are 8000 and 9000, respectively.
- `iso_target_path` (string) - The path where the iso should be saved after
download. By default will go in the packer cache, with a hash of the
original filename as its name.
- `iso_urls` (array of strings) - Multiple URLs for the ISO to download. - `iso_urls` (array of strings) - Multiple URLs for the ISO to download.
Packer will try these in order. If anything goes wrong attempting to Packer will try these in order. If anything goes wrong attempting to
download or while downloading a single URL, it will move on to the next. All download or while downloading a single URL, it will move on to the next. All