2018-05-17 07:37:37 +02:00
|
|
|
resource "matchbox_group" "install" {
|
2017-07-25 08:16:34 +02:00
|
|
|
count = "${length(var.controller_names) + length(var.worker_names)}"
|
|
|
|
|
2018-06-22 09:28:36 +02:00
|
|
|
name = "${format("install-%s", element(concat(var.controller_names, var.worker_names), count.index))}"
|
2018-05-17 08:30:48 +02:00
|
|
|
|
2018-10-15 11:27:32 +02:00
|
|
|
profile = "${local.flavor == "flatcar" ? var.cached_install == "true" ? element(matchbox_profile.cached-flatcar-linux-install.*.name, count.index) : element(matchbox_profile.flatcar-install.*.name, count.index) : var.cached_install == "true" ? element(matchbox_profile.cached-container-linux-install.*.name, count.index) : element(matchbox_profile.container-linux-install.*.name, count.index)}"
|
2017-07-25 08:16:34 +02:00
|
|
|
|
|
|
|
selector {
|
|
|
|
mac = "${element(concat(var.controller_macs, var.worker_macs), count.index)}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "matchbox_group" "controller" {
|
|
|
|
count = "${length(var.controller_names)}"
|
|
|
|
name = "${format("%s-%s", var.cluster_name, element(var.controller_names, count.index))}"
|
2017-09-23 20:49:12 +02:00
|
|
|
profile = "${element(matchbox_profile.controllers.*.name, count.index)}"
|
2017-07-25 08:16:34 +02:00
|
|
|
|
|
|
|
selector {
|
|
|
|
mac = "${element(var.controller_macs, count.index)}"
|
|
|
|
os = "installed"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "matchbox_group" "worker" {
|
|
|
|
count = "${length(var.worker_names)}"
|
|
|
|
name = "${format("%s-%s", var.cluster_name, element(var.worker_names, count.index))}"
|
2017-09-23 20:49:12 +02:00
|
|
|
profile = "${element(matchbox_profile.workers.*.name, count.index)}"
|
2017-07-25 08:16:34 +02:00
|
|
|
|
|
|
|
selector {
|
|
|
|
mac = "${element(var.worker_macs, count.index)}"
|
|
|
|
os = "installed"
|
|
|
|
}
|
|
|
|
}
|