Adding install_snippets support.

During the "real" first boot (install boot), we need tu run butane
config to manipulate disks, so we add install_snippets variable to do
so.

This snippets are added to the install.yaml butane configuration
This commit is contained in:
Philippe Caseiro 2023-08-03 14:12:57 +02:00
parent af27661432
commit 743650c37a
5 changed files with 15 additions and 0 deletions

View File

@ -60,6 +60,7 @@ data "ct_config" "install" {
baseurl_flag = var.cached_install ? "-b ${var.matchbox_http_endpoint}/assets/flatcar" : ""
})
strict = true
snippets = lookup(var.install_snippets, var.controllers.*.name[count.index], [])
}
# Match each controller by MAC

View File

@ -61,6 +61,12 @@ variable "snippets" {
default = {}
}
variable "install_snippets" {
type = map(list(string))
description = "Map from machine names to lists of Container Linux Config snippets to run during install phase"
default = {}
}
variable "worker_node_labels" {
type = map(list(string))
description = "Map from worker names to lists of initial node labels"

View File

@ -55,6 +55,7 @@ data "ct_config" "install" {
baseurl_flag = var.cached_install ? "-b ${var.matchbox_http_endpoint}/assets/flatcar" : ""
})
strict = true
snippets = var.install_snippets
}
# Match a worker to a profile by MAC

View File

@ -60,6 +60,12 @@ variable "snippets" {
default = []
}
variable "install_snippets" {
type = list(string)
description = "List of Butane snippets to run with the install command"
default = []
}
variable "node_labels" {
type = list(string)
description = "List of initial node labels"

View File

@ -22,6 +22,7 @@ module "workers" {
node_labels = lookup(var.worker_node_labels, var.workers[count.index].name, [])
node_taints = lookup(var.worker_node_taints, var.workers[count.index].name, [])
snippets = lookup(var.snippets, var.workers[count.index].name, [])
install_snippets = lookup(var.install_snippets, var.workers[count.index].name, [])
# optional
download_protocol = var.download_protocol