/
main.tf
43 lines (33 loc) · 864 Bytes
/
main.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
resource "libvirt_volume" "bootstrap" {
name = "${var.cluster_id}-bootstrap"
base_volume_id = var.base_volume_id
pool = var.pool
# Bump this so it works for OKD/FCOS too
size = "21474836480"
}
resource "libvirt_ignition" "bootstrap" {
name = "${var.cluster_id}-bootstrap.ign"
content = var.ignition
pool = var.pool
}
resource "libvirt_domain" "bootstrap" {
name = "${var.cluster_id}-bootstrap"
memory = var.bootstrap_memory
vcpu = "2"
coreos_ignition = libvirt_ignition.bootstrap.id
disk {
volume_id = libvirt_volume.bootstrap.id
}
console {
type = "pty"
target_port = 0
}
cpu = {
mode = "host-passthrough"
}
network_interface {
network_id = var.network_id
hostname = "${var.cluster_id}-bootstrap.${var.cluster_domain}"
addresses = var.addresses
}
}