update for nesting and privilege

This commit is contained in:
admin 2026-01-28 15:01:07 -07:00
parent a857ed77ac
commit 5243bb37cb

View file

@ -1,8 +1,13 @@
resource "proxmox_virtual_environment_container" "cattle" {
for_each = var.lxc_inventory
node_name = each.value.node
vm_id = each.key
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
@ -18,7 +23,8 @@ resource "proxmox_virtual_environment_container" "cattle" {
}
operating_system {
template_file_id = "local:vdebian-13-standard_13.1-2_amd64.tar.zst"
# Updated to your Debian 13 template
template_file_id = "local:vztmpl/debian-13-standard_13.1-2_amd64.tar.zst"
type = "debian"
}
@ -30,14 +36,27 @@ resource "proxmox_virtual_environment_container" "cattle" {
dedicated = each.value.memory
}
# Root Disk
disk {
datastore_id = "local-lvm"
size = tonumber(replace(each.value.disk_size, "G", "")) # Converts "20G" to 20
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"
name = "eth0"
bridge = "vmbr0"
vlan_id = each.value.vlan
}
}