From e86f0fb7ab0976d40c1cc5deba03a7ce34ea9da3 Mon Sep 17 00:00:00 2001 From: sammy Date: Mon, 22 Apr 2024 17:43:11 -0400 Subject: [PATCH] PR fixes --- docs/resources/vm_qemu.md | 8 ++++---- proxmox/provider.go | 11 +++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/docs/resources/vm_qemu.md b/docs/resources/vm_qemu.md index 75c6103f..eff7fa57 100644 --- a/docs/resources/vm_qemu.md +++ b/docs/resources/vm_qemu.md @@ -121,7 +121,7 @@ The following arguments are supported in the top level resource block. | `scsihw` | `str` | `"lsi"` | The SCSI controller to emulate. Options: `lsi`, `lsi53c810`, `megasas`, `pvscsi`, `virtio-scsi-pci`, `virtio-scsi-single`. | | `pool` | `str` | | The resource pool to which the VM will be added. | | `tags` | `str` | | Tags of the VM. This is only meta information. | -| `force_create` | `bool` | `false` | If `false`, and a vm of the same name, on the same node exists, terraform will attempt to reconfigure that VM with these settings. Set to true to always create a new VM (note, the name of the VM must still be unique, otherwise an error will be produced. | +| `force_create` | `bool` | `false` | If `false`, and a vm of the same name, on the same node exists, terraform will attempt to reconfigure that VM with these settings. Set to true to always create a new VM (note, the name of the VM must still be unique, otherwise an error will be produced.) | | `os_type` | `str` | | Which provisioning method to use, based on the OS type. Options: `ubuntu`, `centos`, `cloud-init`. | | `force_recreate_on_change_of` | `str` | | If the value of this string changes, the VM will be recreated. Useful for allowing this resource to be recreated when arbitrary attributes change. An example where this is useful is a cloudinit configuration (as the `cicustom` attribute points to a file not the content). | | `os_network_config` | `str` | | Only applies when `define_connection_info` is true. Network configuration to be copied into the VM when preprovisioning `ubuntu` or `centos` guests. The specified configuration is added to `/etc/network/interfaces` for Ubuntu, or `/etc/sysconfig/network-scripts/ifcfg-eth0` for CentOS. Forces re-creation on change. | @@ -166,9 +166,9 @@ details. | ----------- | ------ | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | `str` | | **Required** Network Card Model. The virtio model provides the best performance with very low CPU overhead. If your guest does not support this driver, it is usually best to use e1000. Options: `e1000`, `e1000-82540em`, `e1000-82544gc`, `e1000-82545em`, `i82551`, `i82557b`, `i82559er`, `ne2k_isa`, `ne2k_pci`, `pcnet`, `rtl8139`, `virtio`, `vmxnet3`. | | `macaddr` | `str` | | Override the randomly generated MAC Address for the VM. Requires the MAC Address be Unicast. | -| `bridge` | `str` | `"nat"` | Bridge to which the network device should be attached. The Proxmox VE standard bridge is called | -| `tag` | `int` | `-1` | The VLAN tag to apply to packets on this device. `-1` disables VLAN | -| `firewall` | `bool` | `false` | Whether to enable the Proxmox firewall on this network | +| `bridge` | `str` | `"nat"` | Bridge to which the network device should be attached. The Proxmox VE standard bridge is called `vmbr0`. | +| `tag` | `int` | `-1` | The VLAN tag to apply to packets on this device. `-1` disables VLAN tagging. | +| `firewall` | `bool` | `false` | Whether to enable the Proxmox firewall on this network device. | | `rate` | `int` | `0` | Network device rate limit in mbps (megabytes per second) as floating point number. Set to `0` to disable rate limiting. | | `queues` | `int` | `1` | Number of packet queues to be used on the device. Requires `virtio` model to have an effect. | | `link_down` | `bool` | `false` | Whether this interface should be disconnected (like pulling the plug). | diff --git a/proxmox/provider.go b/proxmox/provider.go index f3346149..9c50fcbd 100644 --- a/proxmox/provider.go +++ b/proxmox/provider.go @@ -193,7 +193,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) { } //permission check - minimum_permissions := []string{ + minimumPermissions := []string{ "Datastore.AllocateSpace", "Datastore.Audit", "Pool.Allocate", @@ -231,8 +231,8 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) { return nil, err } sort.Strings(permlist) - sort.Strings(minimum_permissions) - permDiff := permissions_check(permlist, minimum_permissions) + sort.Strings(minimumPermissions) + permDiff := permissions_check(permlist, minimumPermissions) if len(permDiff) == 0 { // look to see what logging we should be outputting according to the provider configuration logLevels := make(map[string]string) @@ -265,10 +265,9 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) { LogLevels: logLevels, DangerouslyIgnoreUnknownAttributes: d.Get("pm_dangerously_ignore_unknown_attributes").(bool), }, nil - } else { - err = fmt.Errorf("permissions for user/token %s are not sufficient, please provide also the following permissions that are missing: %v", userID.ToString(), permDiff) - return nil, err } + err = fmt.Errorf("permissions for user/token %s are not sufficient, please provide also the following permissions that are missing: %v", userID.ToString(), permDiff) + return nil, err } func getClient(pm_api_url string,