Skip to content

Commit

Permalink
Fix conflicts from branch 'upstream/master' into multi_device
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmed AbouZaid committed Nov 12, 2018
2 parents 217a5cf + 3f07e92 commit 290e847
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
27 changes: 27 additions & 0 deletions docs/terraforminit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# How to get terraform to recognize third party provider

The default installation of terraform has no way of finding custom third party providers. This document shows you how to locate providers so that `terraform init` can find them and copy them to your working terraform directory when creating a new project.

## Locate the provider binaries

Assuming you have followed other directions the deafult locations for these binaries (on a mac at least) are as follows:

```bash
which terraform-provider-proxmox
~/go-workspace/bin/terraform-provider-proxmox
which terraform-provisioner-proxmox
~/go-workspace/bin/terraform-provisioner-proxmox
```

## Copy provider binaries

You need to copy these binaries to the ~/.terraform.d directory which will also need to have a plugins directory created:

```shell
cd ~/.terraform.d
mkdir plugins
cd plugins
cp ~/go-workspace/bin/terraform-provider-proxmox .
cp ~/go-workspace/bin/terraform-provisioner-proxmox .
```
Once this is done, simply create a new terraform directory and do usual terraforming (terraform init etc)
7 changes: 2 additions & 5 deletions proxmox/resource_vm_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,6 @@ func resourceVmQemuCreate(d *schema.ResourceData, meta interface{}) error {
qemuNetworks := devicesSetToMap(networks)
disks := d.Get("disk").(*schema.Set)
qemuDisks := devicesSetToMap(disks)
diskGB := d.Get("disk_gb").(float64)

config := pxapi.ConfigQemu{
Name: vmName,
Expand All @@ -359,7 +358,7 @@ func resourceVmQemuCreate(d *schema.ResourceData, meta interface{}) error {
Ipconfig1: d.Get("ipconfig1").(string),
// Deprecated single disk config.
Storage: d.Get("storage").(string),
DiskSize: diskGB,
DiskSize: d.Get("disk_gb").(float64),
// Deprecated single nic config.
QemuNicModel: d.Get("nic").(string),
QemuBrige: d.Get("bridge").(string),
Expand Down Expand Up @@ -475,7 +474,6 @@ func resourceVmQemuUpdate(d *schema.ResourceData, meta interface{}) error {
qemuDisks := devicesSetToMap(configDisksSet)
configNetworksSet := d.Get("network").(*schema.Set)
qemuNetworks := devicesSetToMap(configNetworksSet)
diskGB := d.Get("disk_gb").(float64)

config := pxapi.ConfigQemu{
Name: vmName,
Expand All @@ -497,7 +495,7 @@ func resourceVmQemuUpdate(d *schema.ResourceData, meta interface{}) error {
Ipconfig1: d.Get("ipconfig1").(string),
// Deprecated single disk config.
Storage: d.Get("storage").(string),
DiskSize: diskGB,
DiskSize: d.Get("disk_gb").(float64),
// Deprecated single nic config.
QemuNicModel: d.Get("nic").(string),
QemuBrige: d.Get("bridge").(string),
Expand Down Expand Up @@ -791,6 +789,5 @@ func preprovision(
}
}
}

return nil
}

0 comments on commit 290e847

Please sign in to comment.