From bd0b1190f615153bf47fc15da4da2855551e0391 Mon Sep 17 00:00:00 2001 From: Taliesin Sisson Date: Tue, 30 Jun 2015 16:39:03 +0100 Subject: [PATCH] When redirecting local ports to hyper visor ports we need to configure WinRM ports as well as SSH ports. --- helper/communicator/step_connect.go | 3 ++- helper/communicator/step_connect_winrm.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/helper/communicator/step_connect.go b/helper/communicator/step_connect.go index f4d1499b7..b42753452 100644 --- a/helper/communicator/step_connect.go +++ b/helper/communicator/step_connect.go @@ -33,6 +33,7 @@ type StepConnect struct { // WinRMConfig should return the default configuration for // connecting via WinRM. WinRMConfig func(multistep.StateBag) (*WinRMConfig, error) + WinRMPort func(multistep.StateBag) (int, error) // CustomConnect can be set to have custom connectors for specific // types. These take highest precedence so you can also override @@ -55,7 +56,7 @@ func (s *StepConnect) Run(state multistep.StateBag) multistep.StepAction { Config: s.Config, Host: s.Host, WinRMConfig: s.WinRMConfig, - WinRMPort: s.SSHPort, + WinRMPort: s.WinRMPort, }, } for k, v := range s.CustomConnect { diff --git a/helper/communicator/step_connect_winrm.go b/helper/communicator/step_connect_winrm.go index 49936ad7b..15f07a872 100644 --- a/helper/communicator/step_connect_winrm.go +++ b/helper/communicator/step_connect_winrm.go @@ -96,6 +96,7 @@ func (s *StepConnectWinRM) waitForWinRM(state multistep.StateBag, cancel <-chan log.Printf("[DEBUG] Error getting WinRM host: %s", err) continue } + port := s.Config.WinRMPort if s.WinRMPort != nil { port, err = s.WinRMPort(state)