-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcluster.tf
54 lines (49 loc) · 1.1 KB
/
cluster.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
resource "proxmox_vm_qemu" "cluster" {
os_type = "cloud-init"
count = 0
clone = var.template
name = "cluster-${count.index + 1}"
target_node = var.target_node
onboot = true
agent = 0
qemu_os = "other"
tags = "rke2_scheduler"
cores = 2
memory = 2048
bios = "seabios"
scsihw = "virtio-scsi-pci"
ipconfig0 = "ip=192.168.2.${count.index + 40}/24,gw=192.168.2.1"
sshkeys = join("", [for key in var.public_ssh_keys : file(key)])
disks {
ide {
ide2 {
cloudinit {
storage = "pool"
}
}
}
scsi {
scsi0 {
disk {
asyncio = "threads"
iothread = true
storage = "pool"
size = "20G"
}
}
}
}
network {
model = "virtio"
bridge = "vmbr0"
}
connection {
type = "ssh"
user = "ubuntu"
private_key = file(var.private_ssh_key)
host = "192.168.2.${count.index + 40}"
}
provisioner "remote-exec" {
inline = ["sudo apt update", "sudo apt install python3 -y"]
}
}