mirror of
https://github.com/apricote/flatcar-packer-hcloud.git
synced 2026-01-13 13:21:01 +00:00
feat: remove unecessary board var
The install script can detect the board itself.
This commit is contained in:
parent
b4a78b31bd
commit
a47095bd2d
2 changed files with 3 additions and 13 deletions
|
|
@ -70,7 +70,6 @@ for [`cluster-api-provider-hetzner`](https://github.com/syself/cluster-api-provi
|
|||
The following variables are supported:
|
||||
|
||||
- `$architecture`: The Hetzner Cloud API architecture (`x86` or `arm`).
|
||||
- `$board`: The Flatcar Board identifier for the architecture (`amd64-usr` or `arm64-usr`).
|
||||
- `$version`: The Flatcar version, if you are using `current`, this is resolved to the actual version in the snapshot.
|
||||
- `$channel`: The Flatcar release channel.
|
||||
|
||||
|
|
@ -78,7 +77,6 @@ The default labels are:
|
|||
|
||||
- `os=flatcar`
|
||||
- `flatcar-channel=$channel`
|
||||
- `flatcar-board=$board`
|
||||
- `version=$version`
|
||||
- `architecture=$architecture`
|
||||
|
||||
|
|
|
|||
|
|
@ -34,25 +34,18 @@ variable "version" {
|
|||
variable "labels" {
|
||||
// Available replacements:
|
||||
// $architecture
|
||||
// $board
|
||||
// $channel
|
||||
// $version - if "current" was specified, this is resolved to the actual version
|
||||
type = map(string)
|
||||
default = {
|
||||
os = "flatcar"
|
||||
flatcar-channel = "$channel"
|
||||
flatcar-board = "$board"
|
||||
version = "$version"
|
||||
architecture = "$architecture"
|
||||
}
|
||||
}
|
||||
|
||||
locals {
|
||||
boards = {
|
||||
x86 = "amd64-usr"
|
||||
arm = "arm64-usr"
|
||||
}
|
||||
|
||||
architectures = ["x86", "arm"]
|
||||
|
||||
// If the user wants the "current" version, we still want to make the
|
||||
|
|
@ -89,11 +82,10 @@ build {
|
|||
snapshot_name = "flatcar-${var.channel}-${local.version}-${source.value}"
|
||||
|
||||
snapshot_labels = {
|
||||
for k, v in var.labels : k => replace(replace(replace(replace(v,
|
||||
for k, v in var.labels : k => replace(replace(replace(v,
|
||||
"$channel", var.channel),
|
||||
"$version", local.version),
|
||||
"$architecture", source.value),
|
||||
"$board", local.boards[source.value])
|
||||
"$architecture", source.value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -106,7 +98,7 @@ build {
|
|||
"chmod +x flatcar-install",
|
||||
|
||||
# Install flatcar
|
||||
"./flatcar-install -s -o hetzner -C ${var.channel} -B ${local.boards[source.name]} -V ${var.version} ",
|
||||
"./flatcar-install -s -o hetzner -C ${var.channel} -V ${var.version} ",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue