allow ssh_host override for OpenStack

pull/7832/head
Megan Marsh 7 years ago
parent eb8c74bf85
commit 0cfe8e7070

@ -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),

@ -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

Loading…
Cancel
Save