2026-02-28 14:16:55 +00:00
|
|
|
data "template_file" "control_plane_cloud_init" {
|
|
|
|
|
count = var.control_plane_count
|
2026-02-27 01:25:25 +00:00
|
|
|
template = file("${path.module}/files/cloud_init_global.tpl")
|
2025-04-17 16:46:19 +01:00
|
|
|
|
|
|
|
|
vars = {
|
2026-02-28 14:16:55 +00:00
|
|
|
hostname = "cp-${count.index + 1}"
|
|
|
|
|
domain = "home.arpa"
|
2026-02-28 12:36:20 +00:00
|
|
|
SSH_KEY_PUBLIC = var.SSH_KEY_PUBLIC
|
2025-04-17 16:46:19 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-28 14:16:55 +00:00
|
|
|
resource "local_file" "control_plane_cloud_init" {
|
|
|
|
|
count = var.control_plane_count
|
|
|
|
|
content = data.template_file.control_plane_cloud_init[count.index].rendered
|
|
|
|
|
filename = "${path.module}/files/rendered/cp-${count.index + 1}.yaml"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
data "template_file" "worker_cloud_init" {
|
|
|
|
|
count = var.worker_count
|
|
|
|
|
template = file("${path.module}/files/cloud_init_global.tpl")
|
|
|
|
|
|
|
|
|
|
vars = {
|
|
|
|
|
hostname = "wk-${count.index + 1}"
|
|
|
|
|
domain = "home.arpa"
|
|
|
|
|
SSH_KEY_PUBLIC = var.SSH_KEY_PUBLIC
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resource "local_file" "worker_cloud_init" {
|
|
|
|
|
count = var.worker_count
|
|
|
|
|
content = data.template_file.worker_cloud_init[count.index].rendered
|
|
|
|
|
filename = "${path.module}/files/rendered/wk-${count.index + 1}.yaml"
|
2025-04-17 16:46:19 +01:00
|
|
|
}
|