packer-cn/builder/vsphere/common/config_ssh.go

16 lines
312 B
Go
Raw Normal View History

package common
2017-08-25 01:08:08 -04:00
import (
2020-11-17 19:31:03 -05:00
"github.com/hashicorp/packer/packer-plugin-sdk/multistep"
2017-08-25 01:08:08 -04: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 01:08:08 -04:00
}