-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmachines.tf
48 lines (39 loc) · 948 Bytes
/
machines.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
resource "proxmox_virtual_environment_vm" "machines" {
for_each = local.machines
node_name = local.proxmox_node
name = each.key
description = "TalOS VM to deploy kubernetes"
on_boot = true
clone {
datastore_id = local.proxmox_images_datastore
node_name = local.proxmox_node
vm_id = proxmox_virtual_environment_vm.talos.vm_id
}
cpu {
cores = var.kubernetes.node_cpus
type = "kvm64"
}
memory {
dedicated = var.kubernetes.node_ram
}
disk {
datastore_id = "nvme"
interface = "scsi0"
size = var.kubernetes.node_disk
file_format = "raw"
}
initialization {
datastore_id = local.proxmox_images_datastore
interface = "ide2"
ip_config {
ipv4 {
address = "${each.value}/${split("/", var.network.cidr)[1]}"
gateway = var.network.gateway
}
}
}
depends_on = [null_resource.import_disk]
lifecycle {
ignore_changes = [started]
}
}