add rocky image
This commit is contained in:
@@ -32,6 +32,7 @@ resource "proxmox_virtual_environment_file" "cloudinit" {
|
||||
|
||||
resource "proxmox_virtual_environment_vm" "nodes" {
|
||||
for_each = local.nodes
|
||||
tags = ["tofu"]
|
||||
|
||||
name = local.hostname_map[each.key]
|
||||
node_name = var.proxmox_node
|
||||
@@ -48,6 +49,8 @@ resource "proxmox_virtual_environment_vm" "nodes" {
|
||||
|
||||
cpu {
|
||||
cores = each.value.cpu
|
||||
type = "host"
|
||||
|
||||
}
|
||||
|
||||
memory {
|
||||
@@ -63,12 +66,24 @@ resource "proxmox_virtual_environment_vm" "nodes" {
|
||||
}
|
||||
}
|
||||
|
||||
disk {
|
||||
dynamic "clone" {
|
||||
for_each = try(each.value.template_id, null) == null ? [] : [each.value.template_id]
|
||||
|
||||
content {
|
||||
vm_id = clone.value
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "disk" {
|
||||
for_each = try(each.value.template_id, null) == null ? [1] : []
|
||||
|
||||
content {
|
||||
datastore_id = each.value.datastore
|
||||
import_from = "${var.image_datastore}:${var.image_file}"
|
||||
interface = var.disk_interface
|
||||
size = each.value.disk
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "disk" {
|
||||
for_each = try([each.value.data_disk], [])
|
||||
|
||||
@@ -12,6 +12,7 @@ variable "nodes" {
|
||||
vmid = optional(number)
|
||||
data_disk = optional(number)
|
||||
cloudinit = optional(string)
|
||||
template_id = optional(number)
|
||||
|
||||
network_devices = list(object({
|
||||
bridge = string
|
||||
|
||||
Reference in New Issue
Block a user