2018-05-17 07:37:37 +02:00
|
|
|
resource "matchbox_group" "install" {
|
2019-10-06 21:57:15 +02:00
|
|
|
count = length(var.controllers) + length(var.workers)
|
2017-07-25 08:16:34 +02:00
|
|
|
|
2019-10-06 21:57:15 +02:00
|
|
|
name = format("install-%s", concat(var.controllers.*.name, var.workers.*.name)[count.index])
|
2018-05-17 08:30:48 +02:00
|
|
|
|
2020-10-21 09:02:29 +02:00
|
|
|
# pick Matchbox profile (Flatcar upstream or Matchbox image cache)
|
|
|
|
profile = var.cached_install ? matchbox_profile.cached-flatcar-install.*.name[count.index] : matchbox_profile.flatcar-install.*.name[count.index]
|
2017-07-25 08:16:34 +02:00
|
|
|
|
2019-03-12 09:19:54 +01:00
|
|
|
selector = {
|
2019-10-06 21:57:15 +02:00
|
|
|
mac = concat(var.controllers.*.mac, var.workers.*.mac)[count.index]
|
2017-07-25 08:16:34 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "matchbox_group" "controller" {
|
2019-10-06 21:57:15 +02:00
|
|
|
count = length(var.controllers)
|
|
|
|
name = format("%s-%s", var.cluster_name, var.controllers[count.index].name)
|
|
|
|
profile = matchbox_profile.controllers.*.name[count.index]
|
2017-07-25 08:16:34 +02:00
|
|
|
|
2019-03-12 09:19:54 +01:00
|
|
|
selector = {
|
2019-10-06 21:57:15 +02:00
|
|
|
mac = var.controllers[count.index].mac
|
2017-07-25 08:16:34 +02:00
|
|
|
os = "installed"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "matchbox_group" "worker" {
|
2019-10-06 21:57:15 +02:00
|
|
|
count = length(var.workers)
|
|
|
|
name = format("%s-%s", var.cluster_name, var.workers[count.index].name)
|
|
|
|
profile = matchbox_profile.workers.*.name[count.index]
|
2017-07-25 08:16:34 +02:00
|
|
|
|
2019-03-12 09:19:54 +01:00
|
|
|
selector = {
|
2019-10-06 21:57:15 +02:00
|
|
|
mac = var.workers[count.index].mac
|
2017-07-25 08:16:34 +02:00
|
|
|
os = "installed"
|
|
|
|
}
|
|
|
|
}
|
2019-05-29 04:19:23 +02:00
|
|
|
|