tf defined vms

This commit is contained in:
counterweight 2025-10-31 08:54:18 +01:00
parent 6f42e43efb
commit 4d8e641466
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
7 changed files with 261 additions and 0 deletions

62
tofu/nodito/variables.tf Normal file
View file

@ -0,0 +1,62 @@
variable "proxmox_api_url" {
description = "Base URL for Proxmox API, e.g. https://nodito:8006/api2/json"
type = string
}
variable "proxmox_api_token_id" {
description = "Proxmox API token ID, e.g. root@pam!tofu"
type = string
sensitive = true
}
variable "proxmox_api_token_secret" {
description = "Proxmox API token secret"
type = string
sensitive = true
}
variable "proxmox_node" {
description = "Target Proxmox node name"
type = string
default = "nodito"
}
variable "zfs_storage_name" {
description = "Proxmox storage name backed by ZFS (from Ansible: zfs_pool_name)"
type = string
default = "proxmox-tank-1"
}
variable "template_name" {
description = "Cloud-init template to clone (created by Ansible)"
type = string
default = "debian-13-cloud-init"
}
variable "cloud_init_user" {
description = "Default cloud-init user"
type = string
default = "counterweight"
}
variable "ssh_authorized_keys" {
description = "SSH public key content to inject via cloud-init"
type = string
sensitive = true
}
variable "vms" {
description = "Map of VMs to create"
type = map(object({
name = string
vmid = optional(number)
cores = number
memory_mb = number
disk_size_gb = number
vlan_tag = optional(number)
ipconfig0 = optional(string) # e.g. "ip=dhcp" or "ip=192.168.1.50/24,gw=192.168.1.1"
}))
default = {}
}