provider/vsphere: provide `host` to provisioner connections

This commit is contained in:
Yuya Kusakabe 2016-03-11 01:11:40 +09:00
parent 539cbe2b01
commit 71d93d2e5c
1 changed files with 9 additions and 0 deletions

View File

@ -439,6 +439,15 @@ func resourceVSphereVirtualMachineCreate(d *schema.ResourceData, meta interface{
}
}
}
if ip, ok := d.GetOk("network_interface.0.ipv4_address"); ok {
d.SetConnInfo(map[string]string{
"host": ip.(string),
})
} else {
log.Printf("[DEBUG] Could not get IP address for %s", d.Id())
}
d.SetId(vm.Path())
log.Printf("[INFO] Created virtual machine: %s", d.Id())