62 lines
No EOL
1.2 KiB
HCL
62 lines
No EOL
1.2 KiB
HCL
resource "proxmox_virtual_environment_container" "cattle" {
|
|
for_each = var.lxc_inventory
|
|
|
|
node_name = each.value.node
|
|
vm_id = each.key
|
|
unprivileged = true # Standard for security
|
|
|
|
features {
|
|
nesting = true # Essential for Docker inside LXC
|
|
}
|
|
|
|
initialization {
|
|
hostname = each.value.hostname
|
|
user_account {
|
|
password = var.lxc_root_password
|
|
}
|
|
ip_config {
|
|
ipv4 {
|
|
address = each.value.ip
|
|
gateway = each.value.gw
|
|
}
|
|
}
|
|
}
|
|
|
|
operating_system {
|
|
# Updated to your Debian 13 template
|
|
template_file_id = "local:vztmpl/debian-13-standard_13.1-2_amd64.tar.zst"
|
|
type = "debian"
|
|
}
|
|
|
|
cpu {
|
|
cores = each.value.cores
|
|
}
|
|
|
|
memory {
|
|
dedicated = each.value.memory
|
|
}
|
|
|
|
# Root Disk
|
|
disk {
|
|
datastore_id = each.value.datastore_id
|
|
size = each.value.disk_size
|
|
}
|
|
|
|
# Mount Point 0 (/docker)
|
|
mount_point {
|
|
volume = each.value.mp0_volume
|
|
path = "/docker"
|
|
}
|
|
|
|
# Mount Point 1 (/repo)
|
|
mount_point {
|
|
volume = each.value.mp1_volume
|
|
path = "/repo"
|
|
}
|
|
|
|
network_interface {
|
|
name = "eth0"
|
|
bridge = "vmbr0"
|
|
vlan_id = each.value.vlan
|
|
}
|
|
} |