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" {
|
resource "proxmox_virtual_environment_container" "cattle" {
|
||||||
for_each = var.lxc_inventory
|
for_each = var.lxc_inventory
|
||||||
|
|
||||||
# Now it looks at the 'node' value for each specific LXC
|
node_name = each.value.node
|
||||||
target_node = each.value.node
|
vm_id = each.key
|
||||||
|
|
||||||
hostname = each.value.hostname
|
initialization {
|
||||||
vmid = each.key
|
hostname = each.value.hostname
|
||||||
ostemplate = "local:vztmpl/ubuntu-22.04-standard_22.04-1_amd64.tar.zst"
|
user_account {
|
||||||
password = var.lxc_root_password
|
password = var.lxc_root_password
|
||||||
unprivileged = true
|
}
|
||||||
|
ip_config {
|
||||||
cores = each.value.cores
|
ipv4 {
|
||||||
memory = each.value.memory
|
address = each.value.ip
|
||||||
|
gateway = each.value.gw
|
||||||
rootfs {
|
}
|
||||||
storage = "local-lvm"
|
}
|
||||||
size = each.value.disk_size
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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"
|
name = "eth0"
|
||||||
bridge = "vmbr0"
|
bridge = "vmbr0"
|
||||||
ip = each.value.ip
|
vlan_id = each.value.vlan
|
||||||
gw = each.value.gw
|
|
||||||
tag = each.value.vlan
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue