-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
79 lines (69 loc) · 1.4 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
resource "proxmox_vm_qemu" "controlplane" {
count = 1
name = "controlplane-0${count.index + 1}"
target_node = var.target_node
vmid = "40${count.index + 1}"
clone = var.template_name
onboot = true
agent = 1
os_type = "cloud-init"
ciuser = "ubuntu"
cores = var.cores
sockets = 1
cpu = "host"
memory = var.memory
scsihw = "virtio-scsi-pci"
bootdisk = "scsi0"
disk {
slot = 0
size = var.disk_size
type = "scsi"
storage = var.storage
}
network {
model = "virtio"
bridge = "vmbr0"
}
lifecycle {
ignore_changes = [
network,
]
}
ipconfig0 = "ip=192.168.100.4${count.index + 1}/24,gw=${var.gw_ns}"
nameserver = var.gw_ns
ssh_private_key = var.ssh_key_path
}
resource "proxmox_vm_qemu" "kube-node" {
count = 2
name = "kube-node-0${count.index + 1}"
target_node = var.target_node
vmid = "50${count.index + 1}"
onboot = true
clone = var.template_name
agent = 1
os_type = "cloud-init"
ciuser = "ubuntu"
cores = var.cores
sockets = 1
cpu = "host"
memory = var.memory
scsihw = "virtio-scsi-pci"
bootdisk = "scsi0"
disk {
slot = 0
size = var.disk_size
type = "scsi"
storage = var.storage
}
network {
model = "virtio"
bridge = "vmbr0"
}
lifecycle {
ignore_changes = [
network,
]
}
ipconfig0 = "ip=192.168.100.5${count.index + 1}/24,gw=${var.gw_ns}"
nameserver = var.gw_ns
}