Compare commits

..

2 commits

Author SHA1 Message Date
4d414c88f0 Cleanup
Some checks failed
/ authentik (push) Failing after 1m11s
/ non-lab (push) Failing after 2m39s
2025-04-16 09:46:17 +00:00
7bea959b7f Switch to tofu 2025-04-16 09:45:56 +00:00
4 changed files with 59 additions and 104 deletions

View file

@ -1,11 +1,11 @@
init: init:
terraform init tofu init
plan: plan:
terraform plan -out tfplan tofu plan -out tfplan
apply:plan apply:plan
terraform apply tfplan tofu apply tfplan
refresh:plan refresh:plan
terraform apply tfplan -refresh-only tofu apply tfplan -refresh-only

View file

@ -20,23 +20,23 @@ locals {
# ignition = data.ignition_config.worker.rendered # ignition = data.ignition_config.worker.rendered
# } # }
resource "matchbox_profile" "worker" { #resource "matchbox_profile" "worker" {
name = "worker" # name = "worker"
kernel = local.kernel # kernel = local.kernel
initrd = [ # initrd = [
"--name main ${local.initrd}" # "--name main ${local.initrd}"
] # ]
args = [ # args = [
"ip=dhcp", # "ip=dhcp",
"initrd=main", # "initrd=main",
"coreos.live.rootfs_url=${local.rootfs}", # "coreos.live.rootfs_url=${local.rootfs}",
"coreos.inst.install_dev=/dev/vda", # "coreos.inst.install_dev=/dev/vda",
"coreos.inst.ignition_url=${var.matchbox_http_endpoint}/ignition?uuid=$${uuid}&mac=$${mac:hexhyp}", # "coreos.inst.ignition_url=${var.matchbox_http_endpoint}/ignition?uuid=$${uuid}&mac=$${mac:hexhyp}",
"console=tty0", # "console=tty0",
"console=ttyS0", # "console=ttyS0",
] # ]
raw_ignition = data.ignition_config.worker.rendered # raw_ignition = data.ignition_config.worker.rendered
} #}
resource "matchbox_profile" "nuc" { resource "matchbox_profile" "nuc" {
name = "nuc" name = "nuc"
@ -67,25 +67,25 @@ resource "matchbox_group" "nuc" {
} }
} }
resource "matchbox_group" "slowworker" { #resource "matchbox_group" "slowworker" {
for_each = var.slowworkers # for_each = var.slowworkers
#
# name = each.key
# profile = matchbox_profile.worker.name
# selector = {
# mac = each.value
# }
#
#}
name = each.key #resource "matchbox_group" "worker" {
profile = matchbox_profile.worker.name # name = "worker"
selector = { # profile = matchbox_profile.worker.name
mac = each.value # selector = {
} # mac = "52:54:00:c3:51:e8"
# }
} #
#}
resource "matchbox_group" "worker" {
name = "worker"
profile = matchbox_profile.worker.name
selector = {
mac = "52:54:00:c3:51:e8"
}
}
data "ignition_user" "core" { data "ignition_user" "core" {
name = "core" name = "core"
@ -95,23 +95,23 @@ data "ignition_user" "core" {
var.ssh_authorized_key var.ssh_authorized_key
] ]
} }
#
data "ignition_config" "worker" { #data "ignition_config" "worker" {
users = [ # users = [
data.ignition_user.core.rendered # data.ignition_user.core.rendered
] # ]
systemd = [ # systemd = [
data.ignition_systemd_unit.qemu_ga.rendered, # data.ignition_systemd_unit.qemu_ga.rendered,
data.ignition_systemd_unit.k3s_install.rendered, # data.ignition_systemd_unit.k3s_install.rendered,
data.ignition_systemd_unit.worker-images-clean-service.rendered, # data.ignition_systemd_unit.worker-images-clean-service.rendered,
data.ignition_systemd_unit.worker-images-clean-timer.rendered # data.ignition_systemd_unit.worker-images-clean-timer.rendered
] # ]
files = [ # files = [
data.ignition_file.worker-options.rendered, # data.ignition_file.worker-options.rendered,
data.ignition_file.k3s_agent_install_script.rendered, # data.ignition_file.k3s_agent_install_script.rendered,
data.ignition_file.worker-images-clean.rendered # data.ignition_file.worker-images-clean.rendered
] # ]
} #}
data "ignition_config" "nuc" { data "ignition_config" "nuc" {
users = [ users = [
data.ignition_user.core.rendered data.ignition_user.core.rendered

View file

@ -1,45 +0,0 @@
resource "matchbox_profile" "talos-controlplane" {
name = "talos-controlplane"
kernel = "http://matchbox.lab.cowley.tech:8080/assets/talos/1.6.2/vmlinuz-amd64"
initrd = [
"http://matchbox.lab.cowley.tech:8080/assets/talos/1.6.2/initramfs-amd64.xz"
]
args = [
"initrd=initramfs.xz",
"init_on_alloc=1",
"slab_nomerge",
"pti=on",
"console=tty0",
"console=ttyS0",
"printk.devkmsg=on",
"talos.platform=metal",
"talos.config=http://matchbox.lab.cowley.tech:8080/assets/talos/controlplane.yaml"
]
}
resource "matchbox_profile" "talos-worker" {
name = "talos-worker"
kernel = "http://matchbox.lab.cowley.tech:8080/assets/talos/1.6.2/vmlinuz-amd64"
initrd = [
"http://matchbox.lab.cowley.tech:8080/assets/talos/1.6.2/initramfs-amd64.xz"
]
args = [
"initrd=initramfs.xz",
"init_on_alloc=1",
"slab_nomerge",
"pti=on",
"console=tty0",
"console=ttyS0",
"printk.devkmsg=on",
"talos.platform=metal",
"talos.config=http://matchbox.lab.cowley.tech:8080/assets/talos/worker.yaml"
]
}
resource "matchbox_group" "controlplane" {
name = "controlplane"
profile = matchbox_profile.talos-controlplane.name
selector = {
mac = "52:54:00:25:b2:8e"
}
}

View file

@ -2,8 +2,8 @@ matchbox_http_endpoint = "http://192.168.6.3:8080"
matchbox_rpc_endpoint = "192.168.6.3:8081" matchbox_rpc_endpoint = "192.168.6.3:8081"
#matchbox_http_endpoint = "http://matchbox.lab.cowley.tech:8080" #matchbox_http_endpoint = "http://matchbox.lab.cowley.tech:8080"
#matchbox_rpc_endpoint = "matchbox.lab.cowley.tech:8081" #matchbox_rpc_endpoint = "matchbox.lab.cowley.tech:8081"
#os_version = "38.20231027.3.2" #os_version = "39.20240104.3.0"
os_version = "39.20240104.3.0" os_version = "41.20250331.3.0"
os_stream = "stable" os_stream = "stable"
ssh_authorized_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMEpF8xS30j9n1a+0FegDYkDis8yHy2ZCj3gvWXmeu5z ccowley@pxe.lab.cowley.tech" ssh_authorized_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMEpF8xS30j9n1a+0FegDYkDis8yHy2ZCj3gvWXmeu5z ccowley@pxe.lab.cowley.tech"
nucs = { nucs = {