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

16 lines
305 B
Go

package common
import (
"github.com/hashicorp/packer-plugin-sdk/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
}
}
}