@@ -20,7 +20,7 @@ terraform {
20
20
required_providers {
21
21
matchbox = {
22
22
source = "poseidon/matchbox"
23
- version = "0.4 .1"
23
+ version = "0.5 .1"
24
24
}
25
25
}
26
26
}
@@ -29,35 +29,38 @@ terraform {
29
29
Define a Matchbox Profile or Group resource in Terraform.
30
30
31
31
``` tf
32
- // Create a Container Linux install profile
33
- resource "matchbox_profile" "container-linux-install" {
34
- name = "container-linux-install"
35
- kernel = "/assets/coreos/${var.container_linux_version}/coreos_production_pxe.vmlinuz"
32
+ // Fedora CoreOS profile
33
+ resource "matchbox_profile" "fedora-coreos-install" {
34
+ name = "worker"
35
+ kernel = "https://builds.coreos.fedoraproject.org/prod/streams/${var.os_stream}/builds/${var.os_version}/x86_64/fedora-coreos-${var.os_version}-live-kernel-x86_64"
36
+
36
37
initrd = [
37
- "/assets/ coreos/ ${var.container_linux_version}/coreos_production_pxe_image.cpio.gz "
38
+ "--name main https://builds. coreos.fedoraproject.org/prod/streams/ ${var.os_stream}/builds/${var.os_version}/x86_64/fedora-coreos-${var.os_version}-live-initramfs.x86_64.img "
38
39
]
40
+
39
41
args = [
40
- "coreos.config.url=http://${var.matchbox_http_endpoint}/ignition?uuid=$${uuid}&mac=$${mac:hexhyp}",
41
- "coreos.first_boot=yes",
42
- "console=tty0",
43
- "console=ttyS0",
44
- "coreos.autologin"
42
+ "initrd=main",
43
+ "coreos.live.rootfs_url=https://builds.coreos.fedoraproject.org/prod/streams/${var.os_stream}/builds/${var.os_version}/x86_64/fedora-coreos-${var.os_version}-live-rootfs.x86_64.img",
44
+ "coreos.inst.install_dev=/dev/sda",
45
+ "coreos.inst.ignition_url=${var.matchbox_http_endpoint}/ignition?uuid=$${uuid}&mac=$${mac:hexhyp}"
45
46
]
46
- container_linux_config = "${file("./cl/coreos-install.yaml.tmpl")}"
47
- generic_config = "${file("./example.ks")}"
47
+
48
+ raw_ignition = data.ct_config.worker.rendered
48
49
}
49
50
50
- // Match a bare-metal machine
51
- resource "matchbox_group" "node1" {
52
- name = "node1"
53
- profile = "${matchbox_profile.container-linux-install.name}"
54
- selector = {
55
- mac = "52:54:00:a1:9c:ae"
56
- }
57
- metadata = {
58
- custom_variable = "machine_specific_value_here"
59
- ssh_authorized_key = "${var.ssh_authorized_key}"
60
- }
51
+ data "ct_config" "worker" {
52
+ content = templatefile("fcc/fedora-coreos.yaml", {
53
+ ssh_authorized_key = var.ssh_authorized_key
54
+ })
55
+ strict = true
56
+ }
57
+
58
+ // Default matcher group for machines
59
+ resource "matchbox_group" "default" {
60
+ name = "default"
61
+ profile = matchbox_profile.fedora-coreos-install.name
62
+ selector = {}
63
+ metadata = {}
61
64
}
62
65
```
63
66
0 commit comments