Commit a23500e0 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/vmware: downloadIso step, although not functional yet

parent e39965e3
......@@ -177,6 +177,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook) packer.Artifact {
rand.Seed(time.Now().UTC().UnixNano())
steps := []multistep.Step{
&stepDownloadISO{},
&stepPrepareOutputDir{},
&stepCreateDisk{},
&stepCreateVMX{},
......
......@@ -21,6 +21,7 @@ type vmxTemplateData struct {
//
// Uses:
// config *config
// iso_path string
// ui packer.Ui
//
// Produces:
......@@ -29,6 +30,7 @@ type stepCreateVMX struct{}
func (stepCreateVMX) Run(state map[string]interface{}) multistep.StepAction {
config := state["config"].(*config)
isoPath := state["iso_path"].(string)
ui := state["ui"].(packer.Ui)
ui.Say("Building and writing VMX file")
......@@ -37,7 +39,7 @@ func (stepCreateVMX) Run(state map[string]interface{}) multistep.StepAction {
config.VMName,
config.GuestOSType,
config.DiskName,
config.ISOUrl,
isoPath,
}
var buf bytes.Buffer
......
package vmware
import (
"github.com/mitchellh/multistep"
"log"
)
// This step downloads the ISO specified.
//
// Uses:
// config *config
// ui packer.Ui
//
// Produces:
// iso_path string
type stepDownloadISO struct{}
func (stepDownloadISO) Run(state map[string]interface{}) multistep.StepAction {
config := state["config"].(*config)
log.Printf("Acquiring lock to download the ISO.")
state["iso_path"] = config.ISOUrl
return multistep.ActionContinue
}
func (stepDownloadISO) Cleanup(map[string]interface{}) {}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment