From ad8a88e366b5cf7ecfc298083d3529dc806b53bd Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Tue, 2 Jul 2019 13:00:55 -0700 Subject: [PATCH] allow ssh_host to override the host ip gathered from the instance for GCP builder --- builder/googlecompute/ssh.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/builder/googlecompute/ssh.go b/builder/googlecompute/ssh.go index e498ed43b..3de529eeb 100644 --- a/builder/googlecompute/ssh.go +++ b/builder/googlecompute/ssh.go @@ -5,6 +5,10 @@ import ( ) func commHost(state multistep.StateBag) (string, error) { + config := state.Get("config").(*Config) + if config.Comm.SSHHost != "" { + return config.Comm.SSHHost, nil + } ipAddress := state.Get("instance_ip").(string) return ipAddress, nil }