0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-30 10:33:46 +00:00

fix(lxc): add missing onboot param on container clone create (#838)

* fix(lxc): add missing start params on container clone create

Signed-off-by: Rafał Safin <rafal.safin@rafsaf.pl>

* fix(lxc): remove set started attr on container clone

Signed-off-by: Rafał Safin <rafal.safin@rafsaf.pl>

* chore(lxc): add `start_on_boot` to example templates

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

---------

Signed-off-by: Rafał Safin <rafal.safin@rafsaf.pl>
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: Rafał Safin <rafal.safin@rafsaf.pl>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
This commit is contained in:
Rafał Safin 2023-12-28 16:48:53 +01:00 committed by GitHub
parent d8f82d47b3
commit 40102a6a50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -1,6 +1,8 @@
resource "proxmox_virtual_environment_container" "example_template" { resource "proxmox_virtual_environment_container" "example_template" {
description = "Managed by Terraform" description = "Managed by Terraform"
start_on_boot = "true"
disk { disk {
datastore_id = element(data.proxmox_virtual_environment_datastores.example.datastore_ids, index(data.proxmox_virtual_environment_datastores.example.datastore_ids, "local-lvm")) datastore_id = element(data.proxmox_virtual_environment_datastores.example.datastore_ids, index(data.proxmox_virtual_environment_datastores.example.datastore_ids, "local-lvm"))
size = 10 size = 10

View File

@ -918,6 +918,9 @@ func containerCreateClone(ctx context.Context, d *schema.ResourceData, m interfa
// Now that the virtual machine has been cloned, we need to perform some modifications. // Now that the virtual machine has been cloned, we need to perform some modifications.
updateBody := &containers.UpdateRequestBody{} updateBody := &containers.UpdateRequestBody{}
startOnBoot := types.CustomBool(d.Get(mkResourceVirtualEnvironmentContainerStartOnBoot).(bool))
updateBody.StartOnBoot = &startOnBoot
console := d.Get(mkResourceVirtualEnvironmentContainerConsole).([]interface{}) console := d.Get(mkResourceVirtualEnvironmentContainerConsole).([]interface{})
if len(console) > 0 { if len(console) > 0 {