43 lines
No EOL
842 B
HCL
43 lines
No EOL
842 B
HCL
resource "proxmox_virtual_environment_container" "cattle" {
|
|
for_each = var.lxc_inventory
|
|
|
|
node_name = each.value.node
|
|
vm_id = each.key
|
|
|
|
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 {
|
|
template_file_id = "local:vztmpl/ubuntu-22.04-standard_22.04-1_amd64.tar.zst"
|
|
type = "ubuntu"
|
|
}
|
|
|
|
cpu {
|
|
cores = each.value.cores
|
|
}
|
|
|
|
memory {
|
|
dedicated = each.value.memory
|
|
}
|
|
|
|
disk {
|
|
datastore_id = "local-lvm"
|
|
size = tonumber(replace(each.value.disk_size, "G", "")) # Converts "20G" to 20
|
|
}
|
|
|
|
network_interface {
|
|
name = "eth0"
|
|
bridge = "vmbr0"
|
|
vlan_id = each.value.vlan
|
|
}
|
|
} |