-
Notifications
You must be signed in to change notification settings - Fork 1
/
coreos.tf
88 lines (71 loc) · 2.43 KB
/
coreos.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
provider "matchbox" {
endpoint = "${local.matchbox_rpc_endpoint}"
client_cert = "${file("${path.module}/cert/client.crt")}"
client_key = "${file("${path.module}/cert/client.key")}"
ca = "${file("${path.module}/cert/ca.crt")}"
}
/////////////////////////////////////////////////////////////////////
// iPXE CoreOS-install profile
resource "matchbox_profile" "coreos-install" {
name = "coreos-install"
kernel = "/assets/coreos/${var.coreos_version}/coreos_production_pxe.vmlinuz"
initrd = [
"/assets/coreos/${var.coreos_version}/coreos_production_pxe_image.cpio.gz",
]
args = [
"initrd=coreos_production_pxe_image.cpio.gz",
"coreos.config.url=${local.matchbox_http_endpoint}/ignition?uuid=$${uuid}&mac=$${mac:hexhyp}",
"coreos.first_boot=yes",
"console=tty0",
"console=ttyS0",
]
container_linux_config = "${file("./cl/coreos-install.yaml.tmpl")}"
}
// ROOT partition wipe profile
resource "matchbox_profile" "wipe" {
name = "wipe"
container_linux_config = "${file("./cl/wipe.yaml.tmpl")}"
}
// Framebuffer enabled node
resource "matchbox_profile" "display" {
name = "display"
container_linux_config = "${file("./cl/display.yaml.tmpl")}"
}
/////////////////////////////////////////////////////////////////////
// Install Container Linux to disk before provisioning
resource "matchbox_group" "default" {
name = "default"
profile = "${matchbox_profile.coreos-install.name}"
// No selector, matches all nodes
metadata {
baseurl = "${local.matchbox_http_endpoint}/assets/coreos"
ignition_endpoint = "${local.matchbox_http_endpoint}/ignition"
ssh_authorized_key = "${var.ssh_authorized_key}"
coreos_version = "${var.coreos_version}"
}
}
resource "matchbox_group" "wipe" {
name = "wipe"
profile = "${matchbox_profile.wipe.name}"
selector {
os = "installed"
}
metadata {
ignition_endpoint = "${local.matchbox_http_endpoint}/ignition"
}
}
resource "matchbox_group" "virt_display" {
name = "virt_display"
profile = "${matchbox_profile.display.name}"
selector {
mac = "${libvirt_domain.display.network_interface.0.mac}"
os = "installed"
append = "1"
}
metadata {
domain_name = "${libvirt_domain.display.name}.vm"
ssh_authorized_key = "${var.ssh_authorized_key}"
vga_mode = "${var.vesafb_vga_mode}"
postinst_script = "${file("./cl/oem-postinst")}"
}
}