update vars again
This commit is contained in:
parent
85612c5d22
commit
137eff456c
1 changed files with 33 additions and 18 deletions
|
|
@ -1,28 +1,43 @@
|
|||
resource "proxmox_virtual_environment_container" "cattle" {
|
||||
for_each = var.lxc_inventory
|
||||
|
||||
# Now it looks at the 'node' value for each specific LXC
|
||||
target_node = each.value.node
|
||||
node_name = each.value.node
|
||||
vm_id = each.key
|
||||
|
||||
initialization {
|
||||
hostname = each.value.hostname
|
||||
vmid = each.key
|
||||
ostemplate = "local:vztmpl/ubuntu-22.04-standard_22.04-1_amd64.tar.zst"
|
||||
user_account {
|
||||
password = var.lxc_root_password
|
||||
unprivileged = true
|
||||
|
||||
cores = each.value.cores
|
||||
memory = each.value.memory
|
||||
|
||||
rootfs {
|
||||
storage = "local-lvm"
|
||||
size = each.value.disk_size
|
||||
}
|
||||
ip_config {
|
||||
ipv4 {
|
||||
address = each.value.ip
|
||||
gateway = each.value.gw
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
network {
|
||||
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"
|
||||
ip = each.value.ip
|
||||
gw = each.value.gw
|
||||
tag = each.value.vlan
|
||||
vlan_id = each.value.vlan
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue