diff --git a/terraform/main.tf b/terraform/main.tf index 607eb99..7cffb8e 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -1,18 +1,19 @@ -resource "proxmox_virtual_environment_container" "disposable_lxc" { - node_name = "pve1" # Which physical server to put it on - vm_id = 201 +resource "proxmox_virtual_environment_container" "managed_lxc" { + node_name = var.target_node + vm_id = var.lxc_id initialization { - hostname = "pve2-lxc1" + hostname = var.lxc_hostname ip_config { ipv4 { - address = "172.16.201.201/24" + # We can even variablize the IP if you want! + address = "172.16.201.${var.lxc_id}/24" gateway = "172.16.201.1" } } } clone { - vm_id = 9000 # YOUR GOLDEN IMAGE ID + vm_id = var.source_template_id } } \ No newline at end of file diff --git a/terraform/variables.tf b/terraform/variables.tf index fdd7731..3eb0fa5 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -1,3 +1,24 @@ variable "pve_endpoint" { type = string } variable "pve_token_id" { type = string } -variable "pve_token_secret" { type = string; sensitive = true } \ No newline at end of file +variable "pve_token_secret" { type = string; sensitive = true } + +# Infrastructure Settings +variable "target_node" { + type = string + default = "pve1" +} + +variable "lxc_id" { + type = number + description = "The ID of the new LXC (e.g., 201)" +} + +variable "source_template_id" { + type = number + default = 9000 + description = "The ID of your Golden Image" +} + +variable "lxc_hostname" { + type = string +} \ No newline at end of file