Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update module for provider compatibility version 3.0.1-rc4 #42

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Update `proxmox` provider to `3.0.1-rc4`.
- Refactor disks implementation for upstream provider.

## [1.8.0] - 2023-04-03

### Added
Expand Down
13 changes: 8 additions & 5 deletions instance.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resource "proxmox_vm_qemu" "proxmox_instance" {
pxe = var.pxe_boot
boot = var.boot
onboot = var.onboot
oncreate = var.oncreate
vm_state = var.vm_state

agent = var.qemu_agent

Expand Down Expand Up @@ -37,14 +37,17 @@ resource "proxmox_vm_qemu" "proxmox_instance" {
dynamic "disk" {
for_each = var.disks
content {
type = disk.value.type
storage = disk.value.storage
size = disk.value.size
discard = disk.value.discard
emulatessd = disk.value.emulatessd
iothread = disk.value.iothread
size = disk.value.size
slot = disk.value.slot
storage = disk.value.storage
type = disk.value.type
}
}

os_type = var.pxe_boot == true ? null : var.os_type
cicustom = var.pxe_boot == true ? null : var.cicustom
# example: "user=${local.citemplate_storage}:${local.snippet_dir}/user-${local.snippet_file_base},network=${local.citemplate_storage}:${local.snippet_dir}/network-${local.snippet_file_base}"
cloudinit_cdrom_storage = var.pxe_boot == true ? null : var.cloudinit_cdrom_storage
}
32 changes: 18 additions & 14 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ variable "onboot" {
type = bool
}

variable "oncreate" {
default = null
description = "Whether to have the VM startup after the VM is created."
type = bool
variable "vm_state" {
default = "running"
description = "Desired power state of the VM."
type = string
}

variable "network_interfaces" {
Expand All @@ -120,13 +120,23 @@ variable "network_interfaces" {
}

variable "disks" {
default = null
description = "List of objects representing additional disks."
type = list(object({
type = string
storage = string
size = string
slot = string
size = string
storage = string
emulatessd = bool
iothread = bool
discard = bool
}))
default = [{
slot = "scsi0"
size = "20G"
storage = "local-lvm"
emulatessd = false
iothread = false
discard = false
}]
}

variable "os_type" {
Expand All @@ -140,9 +150,3 @@ variable "cicustom" {
description = "Path(s) to cloud-init config files (ignored when pxe_boot is true)."
type = string
}

variable "cloudinit_cdrom_storage" {
default = null
description = "Name of the storage to create the cloud-init image in (e.g. local-lvm)."
type = string
}
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
proxmox = {
source = "Telmate/proxmox"
version = ">= 2.9.14"
version = ">= 3.0.1-rc4"
}
}
}
Loading