From e0d46685ea6f0ff545aa561eac858ae7451eaa40 Mon Sep 17 00:00:00 2001 From: Dane Elwell Date: Mon, 3 Aug 2015 17:53:33 +0100 Subject: [PATCH 1/7] Document remote_port option --- website/source/docs/builders/vmware-iso.html.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/source/docs/builders/vmware-iso.html.markdown b/website/source/docs/builders/vmware-iso.html.markdown index 8ac3a9fd312..35c1fb05b80 100644 --- a/website/source/docs/builders/vmware-iso.html.markdown +++ b/website/source/docs/builders/vmware-iso.html.markdown @@ -369,6 +369,8 @@ fill in the required `remote_*` configurations: Additionally, there are some optional configurations that you'll likely have to modify as well: +* `remote_port` - The SSH port of the remote machine + * `remote_datastore` - The path to the datastore where the VM will be stored on the ESXi machine. From e7ab9fb3c0ad801e2e9bd38f8230ba543f8c4554 Mon Sep 17 00:00:00 2001 From: Bryce Fisher-Fleig Date: Wed, 5 Aug 2015 15:28:20 -0700 Subject: [PATCH 2/7] Add missing option --- website/source/docs/builders/virtualbox-iso.html.markdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/website/source/docs/builders/virtualbox-iso.html.markdown b/website/source/docs/builders/virtualbox-iso.html.markdown index 7df4975dc57..61e5d3e166a 100644 --- a/website/source/docs/builders/virtualbox-iso.html.markdown +++ b/website/source/docs/builders/virtualbox-iso.html.markdown @@ -72,6 +72,9 @@ builder. - `ssh_username` (string) - The username to use to SSH into the machine once the OS is installed. +- `ssh_password` (string) - The password to use to SSH into the machine once + the OS is installed. + ### Optional: - `boot_command` (array of strings) - This is an array of commands to type From abb67fdd7964385c23c9a57349bc07158f25798d Mon Sep 17 00:00:00 2001 From: Chris Bednarski Date: Wed, 5 Aug 2015 19:41:29 -0700 Subject: [PATCH 3/7] Fix govet issues --- builder/amazon/common/artifact.go | 2 +- builder/amazon/common/state.go | 2 -- builder/openstack/server.go | 2 -- packer/rpc/server.go | 8 ++++---- provisioner/windows-restart/provisioner.go | 1 - 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/builder/amazon/common/artifact.go b/builder/amazon/common/artifact.go index aba2ffde41e..4082b2abc1a 100644 --- a/builder/amazon/common/artifact.go +++ b/builder/amazon/common/artifact.go @@ -88,7 +88,7 @@ func (a *Artifact) Destroy() error { if len(errors) == 1 { return errors[0] } else { - return &packer.MultiError{errors} + return &packer.MultiError{Errors: errors} } } diff --git a/builder/amazon/common/state.go b/builder/amazon/common/state.go index 075ce8ef72a..3b40a48d1b2 100644 --- a/builder/amazon/common/state.go +++ b/builder/amazon/common/state.go @@ -181,8 +181,6 @@ func WaitForState(conf *StateChangeConf) (i interface{}, err error) { time.Sleep(time.Duration(sleepSeconds) * time.Second) } - - return } func isTransientNetworkError(err error) bool { diff --git a/builder/openstack/server.go b/builder/openstack/server.go index 482657c036e..0897821a897 100644 --- a/builder/openstack/server.go +++ b/builder/openstack/server.go @@ -92,6 +92,4 @@ func WaitForState(conf *StateChangeConf) (i interface{}, err error) { log.Printf("Waiting for state to become: %s currently %s (%d%%)", conf.Target, currentState, currentProgress) time.Sleep(2 * time.Second) } - - return } diff --git a/packer/rpc/server.go b/packer/rpc/server.go index b6d17dacf22..ceb77a8d3b6 100644 --- a/packer/rpc/server.go +++ b/packer/rpc/server.go @@ -1,13 +1,13 @@ package rpc import ( - "fmt" - "github.com/hashicorp/go-msgpack/codec" - "github.com/mitchellh/packer/packer" "io" "log" "net/rpc" "sync/atomic" + + "github.com/hashicorp/go-msgpack/codec" + "github.com/mitchellh/packer/packer" ) var endpointId uint64 @@ -149,7 +149,7 @@ func (s *Server) Serve() { func registerComponent(server *rpc.Server, name string, rcvr interface{}, id bool) string { endpoint := name if id { - fmt.Sprintf("%s.%d", endpoint, atomic.AddUint64(&endpointId, 1)) + log.Printf("%s.%d", endpoint, atomic.AddUint64(&endpointId, 1)) } server.RegisterName(endpoint, rcvr) diff --git a/provisioner/windows-restart/provisioner.go b/provisioner/windows-restart/provisioner.go index 4b6af609e98..2e4b7c3710a 100644 --- a/provisioner/windows-restart/provisioner.go +++ b/provisioner/windows-restart/provisioner.go @@ -134,7 +134,6 @@ WaitLoop: case <-p.cancel: close(waitDone) return fmt.Errorf("Interrupt detected, quitting waiting for machine to restart") - break WaitLoop } } From 94c12c9afcedc128f0aa6eacd25575f684fad2c2 Mon Sep 17 00:00:00 2001 From: Cameron Stokes Date: Thu, 6 Aug 2015 09:27:38 -0700 Subject: [PATCH 4/7] Fix 'ephemeral' misspelling. --- website/source/docs/other/debugging.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/source/docs/other/debugging.html.markdown b/website/source/docs/other/debugging.html.markdown index 8c8012bc8c1..efe01a0cf38 100644 --- a/website/source/docs/other/debugging.html.markdown +++ b/website/source/docs/other/debugging.html.markdown @@ -20,9 +20,9 @@ usually will stop between each step, waiting for keyboard input before continuing. This will allow you to inspect state and so on. In debug mode once the remote instance is instantiated, Packer will emit to the -current directory an emphemeral private ssh key as a .pem file. Using that you +current directory an ephemeral private ssh key as a .pem file. Using that you can `ssh -i ` into the remote build instance and see what is going on -for debugging. The emphemeral key will be deleted at the end of the packer run +for debugging. The ephemeral key will be deleted at the end of the packer run during cleanup. ### Windows From f40ccd55adaa78897fb9daa8e9463c6fac37815a Mon Sep 17 00:00:00 2001 From: Chris Bednarski Date: Thu, 6 Aug 2015 11:02:57 -0700 Subject: [PATCH 5/7] Added debug output to the makefile so I can see which commit travis is building --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 8ff6560a5d7..0ed42652032 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ generate: go generate ./... test: + @echo "Running tests on:"; git symbolic-ref HEAD; git rev-parse HEAD go test $(TEST) $(TESTARGS) -timeout=10s @$(MAKE) vet @@ -29,6 +30,7 @@ testrace: go test -race $(TEST) $(TESTARGS) updatedeps: + @echo "Updating deps on:"; git symbolic-ref HEAD; git rev-parse HEAD go get -u github.com/mitchellh/gox go get -u golang.org/x/tools/cmd/stringer go list ./... \ @@ -37,8 +39,10 @@ updatedeps: | grep -v '/internal/' \ | sort -u \ | xargs go get -f -u -v + @echo "Finished updating deps, now on:"; git symbolic-ref HEAD; git rev-parse HEAD vet: + @echo "Running go vet on:"; git symbolic-ref HEAD; git rev-parse HEAD @go vet 2>/dev/null ; if [ $$? -eq 3 ]; then \ go get golang.org/x/tools/cmd/vet; \ fi From af2fa705bf441699cc12accc25ef3801afc55cd9 Mon Sep 17 00:00:00 2001 From: Chris Bednarski Date: Thu, 6 Aug 2015 12:24:13 -0700 Subject: [PATCH 6/7] Added go vet and git rev-parse head to appveyor so we can see what we're actually building / testing --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 202456f58d7..c5d317da6db 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,6 +31,8 @@ install: build_script: - go test -v ./... + - go vet ./... + - git rev-parse HEAD test: off From 211817c78e4b450b872d3095a778d580a48e5baa Mon Sep 17 00:00:00 2001 From: Chris Bednarski Date: Thu, 6 Aug 2015 16:52:30 -0700 Subject: [PATCH 7/7] Fix formatting for code block in docs --- .../docs/builders/virtualbox-ovf.html.markdown | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/website/source/docs/builders/virtualbox-ovf.html.markdown b/website/source/docs/builders/virtualbox-ovf.html.markdown index b9b2de033a0..0800b14bc0a 100644 --- a/website/source/docs/builders/virtualbox-ovf.html.markdown +++ b/website/source/docs/builders/virtualbox-ovf.html.markdown @@ -19,13 +19,11 @@ image). When exporting from VirtualBox make sure to choose OVF Version 2, since Version 1 is not compatible and will generate errors like this: -==> virtualbox-ovf: Progress state: VBOX\_E\_FILE\_ERROR ==> -virtualbox-ovf: VBoxManage: error: Appliance read failed ==> virtualbox-ovf: -VBoxManage: error: Error reading "source.ova": element "Section" has no "type" -attribute, line 21 ==> virtualbox-ovf: VBoxManage: error: Details: code -VBOX\_E\_FILE\_ERROR (0x80bb0004), component Appliance, interface IAppliance -==> virtualbox-ovf: VBoxManage: error: Context: "int -handleImportAppliance(HandlerArg\*)" at line 304 of file VBoxManageAppliance.cpp + ==> virtualbox-ovf: Progress state: VBOX_E_FILE_ERROR + ==> virtualbox-ovf: VBoxManage: error: Appliance read failed + ==> virtualbox-ovf: VBoxManage: error: Error reading "source.ova": element "Section" has no "type" attribute, line 21 + ==> virtualbox-ovf: VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Appliance, interface IAppliance + ==> virtualbox-ovf: VBoxManage: error: Context: "int handleImportAppliance(HandlerArg*)" at line 304 of file VBoxManageAppliance.cpp The builder builds a virtual machine by importing an existing OVF or OVA file. It then boots this image, runs provisioners on this new VM, and exports that VM