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_virtual_environment_container" "managed_lxc" {
|
||||
node_name = var.target_node
|
||||
vm_id = var.lxc_id
|
||||
resource "proxmox_lxc" "cattle" {
|
||||
for_each = var.lxc_inventory
|
||||
|
||||
initialization {
|
||||
hostname = var.lxc_hostname
|
||||
ip_config {
|
||||
ipv4 {
|
||||
# We can even variablize the IP if you want!
|
||||
address = "172.16.201.${var.lxc_id}/24"
|
||||
gateway = "172.16.201.1"
|
||||
}
|
||||
}
|
||||
# Now it looks at the 'node' value for each specific LXC
|
||||
target_node = each.value.node
|
||||
|
||||
hostname = each.value.hostname
|
||||
vmid = each.key
|
||||
ostemplate = "local:vztmpl/ubuntu-22.04-standard_22.04-1_amd64.tar.zst"
|
||||
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 {
|
||||
vm_id = var.source_template_id
|
||||
network {
|
||||
name = "eth0"
|
||||
bridge = "vmbr0"
|
||||
ip = each.value.ip
|
||||
gw = each.value.gw
|
||||
tag = each.value.vlan
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue