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"
  }
}