mirror of
https://github.com/letic/terraform-provider-proxmox.git
synced 2024-07-01 07:02:40 +00:00
Merge branch 'master' of github.com:Telmate/terraform-provider-proxmox
This commit is contained in:
commit
c208254130
|
@ -177,11 +177,11 @@ func resourceLxc() *schema.Resource {
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"gw": {
|
"gw": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"gw6": {
|
"gw6": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"hwaddr": {
|
"hwaddr": {
|
||||||
|
@ -519,8 +519,10 @@ func resourceLxcRead(d *schema.ResourceData, meta interface{}) error {
|
||||||
d.Set("description", config.Description)
|
d.Set("description", config.Description)
|
||||||
|
|
||||||
defaultFeatures := d.Get("features").(*schema.Set)
|
defaultFeatures := d.Get("features").(*schema.Set)
|
||||||
featuresWithDefaults := UpdateDeviceConfDefaults(config.Features, defaultFeatures)
|
if len(defaultFeatures.List()) > 0 {
|
||||||
d.Set("features", featuresWithDefaults)
|
featuresWithDefaults := UpdateDeviceConfDefaults(config.Features, defaultFeatures)
|
||||||
|
d.Set("features", featuresWithDefaults)
|
||||||
|
}
|
||||||
|
|
||||||
d.Set("force", config.Force)
|
d.Set("force", config.Force)
|
||||||
d.Set("hookscript", config.Hookscript)
|
d.Set("hookscript", config.Hookscript)
|
||||||
|
|
|
@ -71,6 +71,12 @@ func resourceVmQemu() *schema.Resource {
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
"full_clone": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Optional: true,
|
||||||
|
ForceNew: true,
|
||||||
|
Default: true,
|
||||||
|
},
|
||||||
"qemu_os": {
|
"qemu_os": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
|
@ -381,6 +387,10 @@ func resourceVmQemu() *schema.Resource {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
|
"ipconfig2": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Optional: true,
|
||||||
|
},
|
||||||
"preprovision": {
|
"preprovision": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
|
@ -443,6 +453,7 @@ func resourceVmQemuCreate(d *schema.ResourceData, meta interface{}) error {
|
||||||
Sshkeys: d.Get("sshkeys").(string),
|
Sshkeys: d.Get("sshkeys").(string),
|
||||||
Ipconfig0: d.Get("ipconfig0").(string),
|
Ipconfig0: d.Get("ipconfig0").(string),
|
||||||
Ipconfig1: d.Get("ipconfig1").(string),
|
Ipconfig1: d.Get("ipconfig1").(string),
|
||||||
|
Ipconfig2: d.Get("ipconfig2").(string),
|
||||||
// Deprecated single disk config.
|
// Deprecated single disk config.
|
||||||
Storage: d.Get("storage").(string),
|
Storage: d.Get("storage").(string),
|
||||||
DiskSize: d.Get("disk_gb").(float64),
|
DiskSize: d.Get("disk_gb").(float64),
|
||||||
|
@ -486,6 +497,12 @@ func resourceVmQemuCreate(d *schema.ResourceData, meta interface{}) error {
|
||||||
|
|
||||||
// check if ISO or clone
|
// check if ISO or clone
|
||||||
if d.Get("clone").(string) != "" {
|
if d.Get("clone").(string) != "" {
|
||||||
|
fullClone := 1
|
||||||
|
if !d.Get("full_clone").(bool) {
|
||||||
|
fullClone = 0
|
||||||
|
}
|
||||||
|
config.FullClone = &fullClone
|
||||||
|
|
||||||
sourceVmr, err := client.GetVmRefByName(d.Get("clone").(string))
|
sourceVmr, err := client.GetVmRefByName(d.Get("clone").(string))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
pmParallelEnd(pconf)
|
pmParallelEnd(pconf)
|
||||||
|
@ -608,6 +625,7 @@ func resourceVmQemuUpdate(d *schema.ResourceData, meta interface{}) error {
|
||||||
Sshkeys: d.Get("sshkeys").(string),
|
Sshkeys: d.Get("sshkeys").(string),
|
||||||
Ipconfig0: d.Get("ipconfig0").(string),
|
Ipconfig0: d.Get("ipconfig0").(string),
|
||||||
Ipconfig1: d.Get("ipconfig1").(string),
|
Ipconfig1: d.Get("ipconfig1").(string),
|
||||||
|
Ipconfig2: d.Get("ipconfig2").(string),
|
||||||
// Deprecated single disk config.
|
// Deprecated single disk config.
|
||||||
Storage: d.Get("storage").(string),
|
Storage: d.Get("storage").(string),
|
||||||
DiskSize: d.Get("disk_gb").(float64),
|
DiskSize: d.Get("disk_gb").(float64),
|
||||||
|
@ -700,6 +718,7 @@ func resourceVmQemuRead(d *schema.ResourceData, meta interface{}) error {
|
||||||
d.Set("sshkeys", config.Sshkeys)
|
d.Set("sshkeys", config.Sshkeys)
|
||||||
d.Set("ipconfig0", config.Ipconfig0)
|
d.Set("ipconfig0", config.Ipconfig0)
|
||||||
d.Set("ipconfig1", config.Ipconfig1)
|
d.Set("ipconfig1", config.Ipconfig1)
|
||||||
|
d.Set("ipconfig2", config.Ipconfig2)
|
||||||
// Disks.
|
// Disks.
|
||||||
configDisksSet := d.Get("disk").(*schema.Set)
|
configDisksSet := d.Get("disk").(*schema.Set)
|
||||||
activeDisksSet := UpdateDevicesSet(configDisksSet, config.QemuDisks)
|
activeDisksSet := UpdateDevicesSet(configDisksSet, config.QemuDisks)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user