revise for vars
This commit is contained in:
parent
215a8cf461
commit
f19741624d
1 changed files with 23 additions and 15 deletions
|
|
@ -1,20 +1,28 @@
|
||||||
#test of gitea runner
|
resource "proxmox_lxc" "cattle" {
|
||||||
resource "proxmox_virtual_environment_container" "managed_lxc" {
|
for_each = var.lxc_inventory
|
||||||
node_name = var.target_node
|
|
||||||
vm_id = var.lxc_id
|
|
||||||
|
|
||||||
initialization {
|
# Now it looks at the 'node' value for each specific LXC
|
||||||
hostname = var.lxc_hostname
|
target_node = each.value.node
|
||||||
ip_config {
|
|
||||||
ipv4 {
|
hostname = each.value.hostname
|
||||||
# We can even variablize the IP if you want!
|
vmid = each.key
|
||||||
address = "172.16.201.${var.lxc_id}/24"
|
ostemplate = "local:vztmpl/ubuntu-22.04-standard_22.04-1_amd64.tar.zst"
|
||||||
gateway = "172.16.201.1"
|
password = var.lxc_root_password
|
||||||
}
|
unprivileged = true
|
||||||
}
|
|
||||||
|
cores = each.value.cores
|
||||||
|
memory = each.value.memory
|
||||||
|
|
||||||
|
rootfs {
|
||||||
|
storage = "local-lvm"
|
||||||
|
size = each.value.disk_size
|
||||||
}
|
}
|
||||||
|
|
||||||
clone {
|
network {
|
||||||
vm_id = var.source_template_id
|
name = "eth0"
|
||||||
|
bridge = "vmbr0"
|
||||||
|
ip = each.value.ip
|
||||||
|
gw = each.value.gw
|
||||||
|
tag = each.value.vlan
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue