forked from geektx/Terraform-Proxmox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tf
More file actions
55 lines (50 loc) · 1.2 KB
/
main.tf
File metadata and controls
55 lines (50 loc) · 1.2 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
resource "proxmox_vm_qemu" "proxmox_vm_master" {
count = var.num_masters
name = "master-${count.index}"
target_node = var.pm_node_name
clone = var.template_vm_name
os_type = "cloud-init"
agent = 1
memory = var.num_masters_mem
cores = 4
disk {
slot = 0
size = var.master_disk_size
type = var.master_disk_type
storage = var.master_disk_location
iothread = 1
}
ipconfig0 = "ip=${var.master_ips[count.index]}/${var.networkrange},gw=${var.gateway}"
lifecycle {
ignore_changes = [
ciuser,
sshkeys,
network
]
}
}
resource "proxmox_vm_qemu" "proxmox_vm_workers" {
count = var.num_nodes
name = "worker-${count.index}"
target_node = var.pm_node_name
clone = var.template_vm_name
os_type = "cloud-init"
agent = 1
memory = var.num_nodes_mem
cores = 2
disk {
slot = 0
size = var.node_disk_size
type = var.node_disk_type
storage = var.node_disk_location
iothread = 1
}
ipconfig0 = "ip=${var.worker_ips[count.index]}/${var.networkrange},gw=${var.gateway}"
lifecycle {
ignore_changes = [
ciuser,
sshkeys,
network
]
}
}