Merge pull request #5558 from higebu/vsphere-provider

provider/vsphere: provide `host` to provisioner connections
This commit is contained in:
Paul Hinze 2016-03-21 09:20:45 -05:00
commit 60dd52dc52
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()) d.SetId(vm.Path())
log.Printf("[INFO] Created virtual machine: %s", d.Id()) log.Printf("[INFO] Created virtual machine: %s", d.Id())