mirror of
https://github.com/puppetmaster/typhoon.git
synced 2024-12-26 08:29:34 +01:00
5b9dab6659
* Define bare-metal `controllers` and `workers` as a complex type list(object{name=string, mac=string, domain=string}) to allow clusters with many machines to be defined more cleanly * Remove `controller_names` list variable * Remove `controller_macs` list variable * Remove `controller_domains` list variable * Remove `worker_names` list variable * Remove `worker_macs` list variable * Remove `worker_domains` list variable
36 lines
1.3 KiB
HCL
36 lines
1.3 KiB
HCL
resource "matchbox_group" "install" {
|
|
count = length(var.controllers) + length(var.workers)
|
|
|
|
name = format("install-%s", concat(var.controllers.*.name, var.workers.*.name)[count.index])
|
|
|
|
# pick one of 4 Matchbox profiles (Container Linux or Flatcar, cached or non-cached)
|
|
profile = local.flavor == "flatcar" ? var.cached_install ? matchbox_profile.cached-flatcar-linux-install.*.name[count.index] : matchbox_profile.flatcar-install.*.name[count.index] : var.cached_install ? matchbox_profile.cached-container-linux-install.*.name[count.index] : matchbox_profile.container-linux-install.*.name[count.index]
|
|
|
|
selector = {
|
|
mac = concat(var.controllers.*.mac, var.workers.*.mac)[count.index]
|
|
}
|
|
}
|
|
|
|
resource "matchbox_group" "controller" {
|
|
count = length(var.controllers)
|
|
name = format("%s-%s", var.cluster_name, var.controllers[count.index].name)
|
|
profile = matchbox_profile.controllers.*.name[count.index]
|
|
|
|
selector = {
|
|
mac = var.controllers[count.index].mac
|
|
os = "installed"
|
|
}
|
|
}
|
|
|
|
resource "matchbox_group" "worker" {
|
|
count = length(var.workers)
|
|
name = format("%s-%s", var.cluster_name, var.workers[count.index].name)
|
|
profile = matchbox_profile.workers.*.name[count.index]
|
|
|
|
selector = {
|
|
mac = var.workers[count.index].mac
|
|
os = "installed"
|
|
}
|
|
}
|
|
|