2018-01-24 14:04:39 +03:00
|
|
|
package common
|
2017-08-25 02:08:08 -03:00
|
|
|
|
|
|
|
import (
|
2018-04-25 14:22:38 +03:00
|
|
|
"github.com/hashicorp/packer/helper/multistep"
|
2017-08-25 02:08:08 -03:00
|
|
|
)
|
|
|
|
|
2018-12-23 20:16:49 +03:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
2017-08-25 02:08:08 -03:00
|
|
|
}
|