Skip to content

Commit

Permalink
PR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
spettinichi committed Apr 22, 2024
1 parent 819869a commit e86f0fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
8 changes: 4 additions & 4 deletions docs/resources/vm_qemu.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down Expand Up @@ -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). |
Expand Down
11 changes: 5 additions & 6 deletions proxmox/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
}

//permission check
minimum_permissions := []string{
minimumPermissions := []string{
"Datastore.AllocateSpace",
"Datastore.Audit",
"Pool.Allocate",
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit e86f0fb

Please sign in to comment.