-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
35 lines (33 loc) · 955 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
resource "proxmox_vm_qemu" "proxmox_ressources" {
for_each = var.vms
name = each.key
target_node = var.target_node
clone = each.value.clone_base
os_type = each.value.os_type
cores = each.value.cpu
sockets = each.value.sockets
cpu = each.value.cpu_type
memory = each.value.memory
scsihw = each.value.scsihw
bootdisk = each.value.bootdisk
onboot = each.value.onboot
agent = each.value.agent
network {
model = each.value.bridge_model
bridge = each.value.bridge_int
tag = each.value.bridge_tag
}
disk {
type = var.disk_type
storage = var.storage_name
size = var.storage_size
}
ipconfig0 = "ip=${each.value.ip_addr}/24,gw=${each.value.ip_gateway}"
nameserver = each.value.nameserver
searchdomain = each.value.searchdomain
sshkeys = <<EOF
${var.ssh_key}
EOF
ciuser = var.ciuser
cipassword = var.cipassword
}