Files
nixos-servers/terraform/variables.tf
Torjus Håkestad 21a32e0521 terraform: refactor cloud-init to use proxmox_cloud_init_disk resource
Replace SSH upload approach with native proxmox_cloud_init_disk resource
for cleaner, more maintainable cloud-init management.

Changes:
- Use proxmox_cloud_init_disk for all VMs (not just branch-specific ones)
- Include SSH keys, network config, and metadata in cloud-init disk
- Conditionally include NIXOS_FLAKE_BRANCH for VMs with flake_branch set
- Replace ide2 cloudinit disk with cdrom reference to cloud-init disk
- Remove built-in cloud-init parameters (ciuser, sshkeys, etc.)
- Remove cicustom parameter (no longer needed)
- Remove proxmox_host variable (no SSH uploads required)
- Remove .gitignore entry for .generated/ directory

Benefits:
- No SSH access to Proxmox required
- All cloud-init config managed in Terraform
- Consistent approach for all VMs
- Cleaner state management

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-01 17:41:04 +01:00

98 lines
2.3 KiB
HCL

variable "proxmox_api_url" {
description = "Proxmox API URL (e.g., https://proxmox.home.2rjus.net:8006/api2/json)"
type = string
}
variable "proxmox_api_token_id" {
description = "Proxmox API Token ID (e.g., root@pam!terraform)"
type = string
sensitive = true
}
variable "proxmox_api_token_secret" {
description = "Proxmox API Token Secret"
type = string
sensitive = true
}
variable "proxmox_tls_insecure" {
description = "Skip TLS verification (set to true for self-signed certs)"
type = bool
default = true
}
# Default values for VM configurations
# These can be overridden per-VM in vms.tf
variable "default_target_node" {
description = "Default Proxmox node to deploy VMs to"
type = string
default = "pve1"
}
variable "default_template_name" {
description = "Default template VM name to clone from"
type = string
default = "nixos-25.11.20260128.fa83fd8"
}
variable "default_ssh_public_key" {
description = "Default SSH public key for root user"
type = string
default = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAwfb2jpKrBnCw28aevnH8HbE5YbcMXpdaVv2KmueDu6 torjus@gunter"
}
variable "default_storage" {
description = "Default storage backend for VM disks"
type = string
default = "local-zfs"
}
variable "default_bridge" {
description = "Default network bridge"
type = string
default = "vmbr0"
}
variable "default_vlan_tag" {
description = "Default VLAN tag"
type = number
default = 13
}
variable "default_gateway" {
description = "Default network gateway for static IP VMs"
type = string
default = "10.69.13.1"
}
variable "default_nameservers" {
description = "Default DNS nameservers"
type = string
default = "10.69.13.5 10.69.13.6"
}
variable "default_search_domain" {
description = "Default DNS search domain"
type = string
default = "home.2rjus.net"
}
variable "default_cpu_cores" {
description = "Default number of CPU cores"
type = number
default = 2
}
variable "default_memory" {
description = "Default memory in MB"
type = number
default = 2048
}
variable "default_disk_size" {
description = "Default disk size"
type = string
default = "20G"
}