When redirecting local ports to hyper visor ports we need to configure WinRM ports as well as SSH ports.

This commit is contained in:
Taliesin Sisson 2015-06-30 16:39:03 +01:00 committed by Taliesin Sisson
parent f3cc413bbb
commit bd0b1190f6
2 changed files with 3 additions and 1 deletions

View File

@ -33,6 +33,7 @@ type StepConnect struct {
// WinRMConfig should return the default configuration for // WinRMConfig should return the default configuration for
// connecting via WinRM. // connecting via WinRM.
WinRMConfig func(multistep.StateBag) (*WinRMConfig, error) WinRMConfig func(multistep.StateBag) (*WinRMConfig, error)
WinRMPort func(multistep.StateBag) (int, error)
// CustomConnect can be set to have custom connectors for specific // CustomConnect can be set to have custom connectors for specific
// types. These take highest precedence so you can also override // 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, Config: s.Config,
Host: s.Host, Host: s.Host,
WinRMConfig: s.WinRMConfig, WinRMConfig: s.WinRMConfig,
WinRMPort: s.SSHPort, WinRMPort: s.WinRMPort,
}, },
} }
for k, v := range s.CustomConnect { for k, v := range s.CustomConnect {

View File

@ -96,6 +96,7 @@ func (s *StepConnectWinRM) waitForWinRM(state multistep.StateBag, cancel <-chan
log.Printf("[DEBUG] Error getting WinRM host: %s", err) log.Printf("[DEBUG] Error getting WinRM host: %s", err)
continue continue
} }
port := s.Config.WinRMPort port := s.Config.WinRMPort
if s.WinRMPort != nil { if s.WinRMPort != nil {
port, err = s.WinRMPort(state) port, err = s.WinRMPort(state)