-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.tf
39 lines (39 loc) · 1.25 KB
/
bootstrap.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
resource "cloudscale_server" "bootstrap" {
count = var.bootstrap_count
name = "bootstrap.${local.node_name_suffix}"
zone_slug = "${var.region}1"
flavor_slug = "flex-16-4"
image_slug = var.image_slug
volume_size_gb = 128
interfaces {
type = "private"
addresses {
address = cidrhost(local.privnet_cidr, 10)
subnet_uuid = local.subnet_uuid
}
}
user_data = <<-EOF
{
"ignition": {
"version": "3.1.0",
"config": {
"merge": [
{
"source": "${var.ignition_bootstrap}"
}
]
}
},
"systemd": {
"units": [{
"name": "cloudscale-hostkeys.service",
"enabled": true,
"contents": "[Unit]\nDescription=Print SSH Public Keys to tty\nAfter=sshd-keygen.target\n\n[Install]\nWantedBy=multi-user.target\n\n[Service]\nType=oneshot\nStandardOutput=tty\nTTYPath=/dev/ttyS0\nExecStart=/bin/sh -c \"echo '-----BEGIN SSH HOST KEY KEYS-----'; cat /etc/ssh/ssh_host_*key.pub; echo '-----END SSH HOST KEY KEYS-----'\""
}]
}
}
EOF
depends_on = [
module.lb.public_ipv4_addresses,
]
}