mirror of
https://github.com/puppetmaster/typhoon.git
synced 2024-12-26 04:09:34 +01:00
db36959178
* Replace v0.11 bracket type hints with Terraform v0.12 list expressions * Use expression syntax instead of interpolated strings, where suggested * Update bare-metal tutorial * Define `clc_snippets` type constraint map(list(string)) * Define Terraform and plugin version requirements in versions.tf * Require matchbox ~> 0.3.0 to support Terraform v0.12 * Require ct ~> 0.3.2 to support Terraform v0.12
36 lines
1.4 KiB
HCL
36 lines
1.4 KiB
HCL
resource "matchbox_group" "install" {
|
|
count = length(var.controller_names) + length(var.worker_names)
|
|
|
|
name = format("install-%s", element(concat(var.controller_names, var.worker_names), count.index))
|
|
|
|
# pick one of 4 Matchbox profiles (Container Linux or Flatcar, cached or non-cached)
|
|
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)
|
|
|
|
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))
|
|
profile = element(matchbox_profile.controllers.*.name, count.index)
|
|
|
|
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))
|
|
profile = element(matchbox_profile.workers.*.name, count.index)
|
|
|
|
selector = {
|
|
mac = element(var.worker_macs, count.index)
|
|
os = "installed"
|
|
}
|
|
}
|
|
|