mirror of
https://github.com/puppetmaster/typhoon.git
synced 2024-12-26 06:19:33 +01:00
bca96bb124
* Template bare-metal Container Linux configs with Terraform's (limited) template_file module. This allows rendering problems to be identified during `terraform plan` and is favored over using the Matchbox templating feature when the configs are served to PXE booting nodes. * Writes a Matchbox profile for each machine, which will be served as-is. The effect is the same, each node gets provisioned with its own Container Linux config.
42 lines
1.4 KiB
HCL
42 lines
1.4 KiB
HCL
// Install Container Linux to disk
|
|
resource "matchbox_group" "container-linux-install" {
|
|
count = "${length(var.controller_names) + length(var.worker_names)}"
|
|
|
|
name = "${format("container-linux-install-%s", element(concat(var.controller_names, var.worker_names), count.index))}"
|
|
profile = "${var.cached_install == "true" ? matchbox_profile.cached-container-linux-install.name : matchbox_profile.container-linux-install.name}"
|
|
|
|
selector {
|
|
mac = "${element(concat(var.controller_macs, var.worker_macs), count.index)}"
|
|
}
|
|
|
|
metadata {
|
|
ssh_authorized_key = "${var.ssh_authorized_key}"
|
|
}
|
|
}
|
|
|
|
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"
|
|
}
|
|
|
|
metadata {
|
|
etcd_on_host = "${var.experimental_self_hosted_etcd ? "false" : "true"}"
|
|
}
|
|
}
|
|
|
|
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"
|
|
}
|
|
}
|