diff --git a/builder/openstack/builder.go b/builder/openstack/builder.go index 661913dd0..9822626aa 100644 --- a/builder/openstack/builder.go +++ b/builder/openstack/builder.go @@ -133,6 +133,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack &communicator.StepConnect{ Config: &b.config.RunConfig.Comm, Host: CommHost( + b.config.RunConfig.Comm.SSHHost, computeClient, b.config.Comm.SSHInterface, b.config.Comm.SSHIPVersion), diff --git a/builder/openstack/ssh.go b/builder/openstack/ssh.go index 0fd9f794b..1f93363c4 100644 --- a/builder/openstack/ssh.go +++ b/builder/openstack/ssh.go @@ -14,10 +14,16 @@ import ( // CommHost looks up the host for the communicator. func CommHost( + host string, client *gophercloud.ServiceClient, sshinterface string, sshipversion string) func(multistep.StateBag) (string, error) { return func(state multistep.StateBag) (string, error) { + if host != "" { + log.Printf("Using ssh_host value: %s", host) + return host, nil + } + s := state.Get("server").(*servers.Server) // If we have a specific interface, try that