add rocky image

This commit is contained in:
Iurii Anfinogenov
2026-05-04 06:30:51 +00:00
parent 40694927c8
commit 326572de4d
4 changed files with 60 additions and 53 deletions

View File

@@ -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], [])

View File

@@ -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