mirror of
https://github.com/hashicorp/packer.git
synced 2026-07-16 12:23:37 -04:00
Merge pull request #2513 from hazelesque/openstack-ip-debug-logging
openstack builder: log which IP address SSH will use
This commit is contained in:
commit
bd0ee8d3f7
1 changed files with 4 additions and 0 deletions
|
|
@ -23,6 +23,7 @@ func CommHost(
|
|||
// If we have a specific interface, try that
|
||||
if sshinterface != "" {
|
||||
if addr := sshAddrFromPool(s, sshinterface); addr != "" {
|
||||
log.Printf("[DEBUG] Using IP address %s from specified interface %s for SSH", addr, sshinterface)
|
||||
return addr, nil
|
||||
}
|
||||
}
|
||||
|
|
@ -30,15 +31,18 @@ func CommHost(
|
|||
// If we have a floating IP, use that
|
||||
ip := state.Get("access_ip").(*floatingip.FloatingIP)
|
||||
if ip != nil && ip.IP != "" {
|
||||
log.Printf("[DEBUG] Using floating IP %s for SSH", ip.IP)
|
||||
return ip.IP, nil
|
||||
}
|
||||
|
||||
if s.AccessIPv4 != "" {
|
||||
log.Printf("[DEBUG] Using AccessIPv4 %s for SSH", s.AccessIPv4)
|
||||
return s.AccessIPv4, nil
|
||||
}
|
||||
|
||||
// Try to get it from the requested interface
|
||||
if addr := sshAddrFromPool(s, sshinterface); addr != "" {
|
||||
log.Printf("[DEBUG] Using IP address %s for SSH", addr)
|
||||
return addr, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue