mirror of
https://github.com/hashicorp/packer.git
synced 2026-02-23 01:40:26 -05:00
15 lines
301 B
Go
15 lines
301 B
Go
package common
|
|
|
|
import (
|
|
"github.com/hashicorp/packer/helper/multistep"
|
|
)
|
|
|
|
func CommHost(host string) func(multistep.StateBag) (string, error) {
|
|
return func(state multistep.StateBag) (string, error) {
|
|
if host != "" {
|
|
return host, nil
|
|
} else {
|
|
return state.Get("ip").(string), nil
|
|
}
|
|
}
|
|
}
|