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" { resource "proxmox_virtual_environment_container" "cattle" {
for_each = var.lxc_inventory for_each = var.lxc_inventory
node_name = each.value.node node_name = each.value.node
vm_id = each.key vm_id = each.key
unprivileged = true # Standard for security
features {
nesting = true # Essential for Docker inside LXC
}
initialization { initialization {
hostname = each.value.hostname hostname = each.value.hostname
@ -18,7 +23,8 @@ resource "proxmox_virtual_environment_container" "cattle" {
} }
operating_system { 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" type = "debian"
} }
@ -30,14 +36,27 @@ resource "proxmox_virtual_environment_container" "cattle" {
dedicated = each.value.memory dedicated = each.value.memory
} }
# Root Disk
disk { disk {
datastore_id = "local-lvm" datastore_id = each.value.datastore_id
size = tonumber(replace(each.value.disk_size, "G", "")) # Converts "20G" to 20 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 { network_interface {
name = "eth0" name = "eth0"
bridge = "vmbr0" bridge = "vmbr0"
vlan_id = each.value.vlan vlan_id = each.value.vlan
} }
} }